/usr/share/doc/vim/vim-policy.html/x113.html is in vim-doc 2:8.0.1453-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Packaging of Vim Addons</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Debian Packaging Policy for Vim"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Vim Packaging"
HREF="x73.html"><LINK
REL="NEXT"
TITLE="Tools"
HREF="x221.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Debian Packaging Policy for <SPAN
CLASS="application"
>Vim</SPAN
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x73.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x221.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="addon-packaging"
>3. Packaging of <SPAN
CLASS="application"
>Vim</SPAN
> Addons</A
></H1
><P
> With the term (<SPAN
CLASS="application"
>Vim</SPAN
>) <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>addon</I
></SPAN
> we refer to an
extension for the <SPAN
CLASS="application"
>Vim</SPAN
> editor which is not shipped with the editor
itself. Examples of addons which can be frequently found on the Internet
are color schemes, syntax and corresponding higlighting definitions for
new languages, indentation definitions, generic and filetype-specific
plugins, ... </P
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="addon-structure"
>3.1. Addon Structure</A
></H2
><P
> An addon is usually composed of a set of <TT
CLASS="filename"
>.vim</TT
>
files; other kind of files, for example <TT
CLASS="filename"
>.txt</TT
> files
for documentation purposes, can be provided as well.
For instance, the following files compose the <A
HREF="http://www.vim.org/scripts/script.php?script_id=90"
TARGET="_top"
><SPAN
CLASS="application"
>vcscommand</SPAN
></A
>
addon, providing plugins, syntax higlighting definitions, and
documentation:
<DIV
CLASS="example"
><A
NAME="AEN127"
></A
><P
><B
>Example 1. Files composing the
<SPAN
CLASS="application"
>vcscommand</SPAN
> addon</B
></P
><PRE
CLASS="programlisting"
>syntax/vcscommit.vim
syntax/SVNAnnotate.vim
syntax/CVSAnnotate.vim
plugin/vcssvn.vim
plugin/vcscvs.vim
plugin/vcscommand.vim
doc/vcscommand.txt</PRE
></DIV
>
</P
><P
> For an addon to work properly (and its plugins being automatically
loaded by <SPAN
CLASS="application"
>Vim</SPAN
>) all its files should be installed under a directory
which is a component of the <SPAN
CLASS="application"
>Vim</SPAN
> runtime path, in the appropriate
subdirectories. In the example above, if
<TT
CLASS="filename"
>/usr/share/vim/vim73/</TT
> is the chosen component
and if <SPAN
CLASS="application"
>vcscommand</SPAN
> should be installed there,
then <TT
CLASS="filename"
>SVNAnnotate.vim</TT
> should be installed as
<TT
CLASS="filename"
>/usr/share/vim/vim73/syntax/SVNAnnotate.vim</TT
>,
<TT
CLASS="filename"
>vcssvn.vim</TT
> as
<TT
CLASS="filename"
>/usr/share/vim/vim73/plugin/vcssvn.vim</TT
>, and so
on. </P
><P
> Addons should <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>not</I
></SPAN
> be installed directly under
a directory contained in the <SPAN
CLASS="application"
>Vim</SPAN
> runtime path. This is because addons
can conflict with each other and also because automatically loading
plugins takes time. Therefore users shall be given the freedom to choose
which addons they want to have enabled and which they don't. The
suggested directory where to install addons is
<TT
CLASS="filename"
>/usr/share/vim/addons</TT
>, but any other directory not
in the <SPAN
CLASS="application"
>Vim</SPAN
> runtime path will do, as long as you install there a file
tree with the appropriate sub-directories in place
(<TT
CLASS="filename"
>syntax/</TT
>, <TT
CLASS="filename"
>plugin/</TT
>, ...).
</P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="addon-packages"
>3.2. Addon Packages</A
></H2
><P
> Each non-trivial addon<A
NAME="AEN150"
HREF="#FTN.AEN150"
><SPAN
CLASS="footnote"
>[1]</SPAN
></A
> should
be packaged and distributed in Debian as a separate package.
It is recommended that the package is named according to the
naming convention
<SPAN
CLASS="application"
>vim-<TT
CLASS="replaceable"
><I
>ADDON</I
></TT
> </SPAN
>
where <TT
CLASS="replaceable"
><I
>ADDON</I
></TT
> is a name identifying the
packaged addon. Trivial addons should be collected in suites of
<SPAN
CLASS="application"
>Vim</SPAN
> addons and packaged as aggregated Debian packages. An
example of such a suite is distributed as the <A
HREF="http://packages.qa.debian.org/vim-scripts"
TARGET="_top"
> <SPAN
CLASS="application"
>vim-script</SPAN
> package</A
>. </P
><P
> To ease management of addons (e.g. enabling and disabling
them) by both the final users and the local system
administrators, each packaged addon should be registered in the
<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
><SPAN
CLASS="application"
>Vim</SPAN
> addon registry</I
></SPAN
>. The registry is
(conceptually) a set of entries, one entry per addon, describing
the addon from the point of view of who should configure it: its
name and brief description, where it is located on disk, ... All
such information should be easily findable in the upstream
documentation of the addon. </P
><P
> Practically, each Debian package shipping <SPAN
CLASS="application"
>Vim</SPAN
> addons
should provide a single file in <A
HREF="http://www.yaml.org"
TARGET="_top"
>YAML</A
> format describing
<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>all</I
></SPAN
> addons shipped by the package. The
file should be installed by the package in
<TT
CLASS="filename"
>/usr/share/vim/registry/</TT
> and should be
named according to the convention
<TT
CLASS="filename"
><TT
CLASS="replaceable"
><I
>PKGNAME</I
></TT
>.yaml</TT
>,
where <TT
CLASS="replaceable"
><I
>PKGNAME</I
></TT
> is the name of the
Debian package shipping it. There is no need to create the
file in postinst, you can ship it normally as a file contained
in your package.<A
NAME="AEN169"
HREF="#FTN.AEN169"
><SPAN
CLASS="footnote"
>[2]</SPAN
></A
> </P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="registry-entry"
>3.3. Registry Entries</A
></H2
><P
> The following information should be made available for each
addon registered in the addon registry: <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>addon</I
></SPAN
> (required
field)</DT
><DD
><P
>short name of the addon,
will be used to refer to the addon (also in command line
tools, so beware of spaces, they can be annoying)
</P
></DD
><DT
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>description</I
></SPAN
>
(required field)</DT
><DD
><P
>brief description
of the addon, in the same spirit of Debian package
short descriptions</P
></DD
><DT
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>files</I
></SPAN
> (required
field)</DT
><DD
><P
> list of files which
compose the addon. Intuitively all these files should
be made available in the appropriate components of the
<SPAN
CLASS="application"
>Vim</SPAN
> runtime path for the addon to be working properly.
Each file must be specified relative to a component of
the <SPAN
CLASS="application"
>Vim</SPAN
> runtime path. </P
></DD
><DT
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>basedir</I
></SPAN
> (optional
field, default:
<TT
CLASS="filename"
>/usr/share/vim/addons</TT
>)</DT
><DD
><P
> directory where the files composing the
addon reside on the filesystem. This field is optional.
</P
></DD
><DT
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>disabledby</I
></SPAN
>
(optional field)</DT
><DD
><P
> <SPAN
CLASS="application"
>Vim</SPAN
> script
command that can be used (usually by adding it to
<TT
CLASS="filename"
>~/.vimrc</TT
>) to prevent the addon to
be used even when it is loaded. The intended usage of
this field is to "blacklist" an undesired addon which
files are available, and hence automatically loaded by
<SPAN
CLASS="application"
>Vim</SPAN
>, in a component of the <SPAN
CLASS="application"
>Vim</SPAN
> runtime path. This
field is optional, if missing the addon cannot be
blacklisted. </P
></DD
></DL
></DIV
> </P
><P
> Note the relevance of the <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>disabledby</I
></SPAN
>
field: having it is the only way for a user to prevent the
automatic loading of an addon which has been installed
system-wide by the local system administrator. If the addon you
are packaging does not provide a way to be disabled you should
patch it to support disabling and forward your patch upstream.
Have a look at the <A
HREF="http://git.debian.org/?p=pkg-vim/vim-scripts.git;a=tree;f=debian/patches;hb=HEAD"
TARGET="_top"
>Debian-specific
patches</A
> in the <A
HREF="http://packages.qa.debian.org/vim-scripts"
TARGET="_top"
><SPAN
CLASS="application"
>vim-scripts</SPAN
></A
>
package for an idea about how to do it. </P
><P
> A YAML file describing registry entries is a standard YAML
file with multiple top-level entries (one per registry entry).
All field mentioned above are singleton string fields with the
exception of <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>files</I
></SPAN
> which contains a list of
strings (one for each shipped file). See the <A
HREF="http://yaml.org/spec/"
TARGET="_top"
>YAML file format
specification</A
> for reference ... or the examples of
<A
HREF="a245.html"
>Appendix A</A
> to learn by example.
</P
><P
> You should not attempt to automatically enable the plugin in the
postinst for the reasons mentioned above. It is recommended that
enabling of addons should be delegated to the local system administrator
and users. If you really feel the need to, please consider using <A
HREF="http://packages.qa.debian.org/debconf"
TARGET="_top"
>debconf</A
> as a way
to opt-out from the automatic enabling, and do that strictly using
<SPAN
CLASS="application"
>vim-addon-manager</SPAN
> (see <A
HREF="x221.html"
>Section 4</A
>), so that users can blacklist the automatically loaded addon.
</P
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN150"
HREF="x113.html#AEN150"
><SPAN
CLASS="footnote"
>[1]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
> meaning with
"non-trivial" that its size justifies the creation of a
Debian package for that, YMMV </P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN169"
HREF="x113.html#AEN169"
><SPAN
CLASS="footnote"
>[2]</SPAN
></A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
> In the future we might
provide a debhelper to installed <SPAN
CLASS="application"
>Vim</SPAN
> registry files in the
right place, but it is not available yet. </P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x73.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x221.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><SPAN
CLASS="application"
>Vim</SPAN
> Packaging</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
> </TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Tools</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|