vim.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-vim" role="wrap">
  8. <?dbhtml filename="vim.html"?>
  9. <sect1info condition="script">
  10. <productname>vim</productname>
  11. <productnumber>&vim-version;</productnumber>
  12. <address>&vim-url;<otheraddr>&vim-lang-url;</otheraddr></address>
  13. </sect1info>
  14. <title>Vim-&vim-version;</title>
  15. <indexterm zone="ch-system-vim">
  16. <primary sortas="a-Vim">Vim</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Vim package contains a powerful text editor.</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&vim-ch6-sbu;</seg>
  26. <seg>&vim-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. <tip>
  30. <title>Alternatives to Vim</title>
  31. <para>If you prefer another editor&mdash;such as Emacs, Joe, or
  32. Nano&mdash;please refer to <ulink
  33. url="&blfs-root;view/svn/postlfs/editors.html"/> for suggested
  34. installation instructions.</para>
  35. </tip>
  36. </sect2>
  37. <sect2 role="installation">
  38. <title>Installation of Vim</title>
  39. <para>First, unpack both
  40. <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
  41. <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
  42. same directory.</para>
  43. <para>Apply a patch which fixes various issues already found and fixed by
  44. the upstream maintainers since the inital release of Vim-&vim-version;:
  45. </para>
  46. <screen><userinput remap="pre">patch -Np1 -i ../&vim-fixes-patch;</userinput></screen>
  47. <para>This version of Vim installs translated man pages and places
  48. them into directories that will not be searched by Man-DB. Patch Vim
  49. so that it installs its man pages into searchable directories and
  50. ultimately allows Man-DB to transcode the page into the desired format
  51. at run-time:</para>
  52. <screen><userinput remap="pre">patch -Np1 -i ../&vim-mandir-patch;</userinput></screen>
  53. <para>Finally, change the default location of the
  54. <filename>vimrc</filename> configuration file to <filename
  55. class="directory">/etc</filename>:</para>
  56. <screen><userinput remap="pre">echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
  57. <para>Now prepare Vim for compilation:</para>
  58. <screen><userinput remap="configure">./configure --prefix=/usr --enable-multibyte</userinput></screen>
  59. <variablelist>
  60. <title>The meaning of the configure options:</title>
  61. <varlistentry>
  62. <term><parameter>--enable-multibyte</parameter></term>
  63. <listitem>
  64. <para>This switch enables support for editing files in multibyte
  65. character encodings. This is needed if using a locale with a
  66. multibyte character set. This switch is also helpful to be able
  67. to edit text files initially created in Linux distributions like
  68. Fedora Core that use UTF-8 as a default character set.</para>
  69. </listitem>
  70. </varlistentry>
  71. </variablelist>
  72. <para>Compile the package:</para>
  73. <screen><userinput remap="make">make</userinput></screen>
  74. <para>To test the results, issue:</para>
  75. <screen><userinput remap="test">make test</userinput></screen>
  76. <para>However, this test suite outputs a lot of binary data to the screen,
  77. which can cause issues with the settings of the current terminal. This can
  78. be resolved by redirecting the output to a log file.</para>
  79. <para>Install the package:</para>
  80. <screen><userinput remap="install">make install</userinput></screen>
  81. <para>Many users are used to using <command>vi</command> instead of
  82. <command>vim</command>. To allow execution of <command>vim</command>
  83. when users habitually enter <command>vi</command>, create a
  84. symlink for both the binary and the man page in the provided
  85. languages:</para>
  86. <screen><userinput remap="install">ln -sv vim /usr/bin/vi
  87. for L in "" fr it pl ru; do
  88. ln -sv vim.1 /usr/share/man/$L/man1/vi.1
  89. done</userinput></screen>
  90. <para>By default, Vim's documentation is installed in <filename
  91. class="directory">/usr/share/vim</filename>. The following symlink
  92. allows the documentation to be accessed via <filename
  93. class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
  94. it consistent with the location of documentation for other packages:</para>
  95. <screen><userinput remap="install">ln -sv ../&vim-docdir;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
  96. <para>If an X Window System is going to be installed on the LFS
  97. system, it may be necessary to recompile Vim after installing X. Vim
  98. comes with a GUI version of the editor that requires X and some
  99. additional libraries to be installed. For more information on this
  100. process, refer to the Vim documentation and the Vim installation page
  101. in the BLFS book at <ulink
  102. url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
  103. </sect2>
  104. <sect2 id="conf-vim" role="configuration">
  105. <title>Configuring Vim</title>
  106. <indexterm zone="conf-vim">
  107. <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
  108. </indexterm>
  109. <para>By default, <command>vim</command> runs in vi-incompatible mode.
  110. This may be new to users who have used other editors in the past. The
  111. <quote>nocompatible</quote> setting is included below to highlight the
  112. fact that a new behavior is being used. It also reminds those who would
  113. change to <quote>compatible</quote> mode that it should be the first
  114. setting in the configuration file. This is necessary because it changes
  115. other settings, and overrides must come after this setting. Create a default
  116. <command>vim</command> configuration file by running the following:</para>
  117. <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
  118. <literal>" Begin /etc/vimrc
  119. set nocompatible
  120. set backspace=2
  121. syntax on
  122. if (&amp;term == "iterm") || (&amp;term == "putty")
  123. set background=dark
  124. endif
  125. " End /etc/vimrc</literal>
  126. EOF</userinput></screen>
  127. <para>The <parameter>set nocompatible</parameter> setting makes
  128. <command>vim</command> behave in a more useful way (the default) than
  129. the vi-compatible manner. Remove the <quote>no</quote> to keep the
  130. old <command>vi</command> behavior. The <parameter>set
  131. backspace=2</parameter> setting allows backspacing over line breaks,
  132. autoindents, and the start of insert. The <parameter>syntax
  133. on</parameter> parameter enables vim's syntax highlighting. Finally,
  134. the <emphasis>if</emphasis> statement with the <parameter>set
  135. background=dark</parameter> setting corrects <command>vim</command>'s
  136. guess about the background color of some terminal emulators. This
  137. gives the highlighting a better color scheme for use on the black
  138. background of these programs.</para>
  139. <para>Documentation for other available options can be obtained by
  140. running the following command:</para>
  141. <screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
  142. <note>
  143. <para>By default, Vim only installs spell files for the English language.
  144. To install spell files for your preferred language, download the
  145. <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
  146. files for your language and character encoding from <ulink
  147. url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
  148. <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
  149. <para>To use these spell files, some configuration in
  150. <filename>/etc/vimrc</filename> is needed, e.g.:</para>
  151. <screen><literal>set spelllang=en,ru
  152. set spell</literal></screen>
  153. <para>For more information, see the appropriate README file located
  154. at the URL above.</para>
  155. </note>
  156. </sect2>
  157. <sect2 id="contents-vim" role="content">
  158. <title>Contents of Vim</title>
  159. <segmentedlist>
  160. <segtitle>Installed programs</segtitle>
  161. <seglistitem>
  162. <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
  163. pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
  164. vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
  165. vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
  166. </seglistitem>
  167. </segmentedlist>
  168. <variablelist>
  169. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  170. <?dbfo list-presentation="list"?>
  171. <?dbhtml list-presentation="table"?>
  172. <varlistentry id="efm_filter.pl">
  173. <term><command>efm_filter.pl</command></term>
  174. <listitem>
  175. <para>A filter for creating an error file that can be read
  176. by <command>vim</command></para>
  177. <indexterm zone="ch-system-vim efm_filter.pl">
  178. <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
  179. </indexterm>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry id="efm_perl.pl">
  183. <term><command>efm_perl.pl</command></term>
  184. <listitem>
  185. <para>Reformats the error messages of the Perl interpreter for use
  186. with the <quote>quickfix</quote> mode of <command>vim</command></para>
  187. <indexterm zone="ch-system-vim efm_perl.pl">
  188. <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
  189. </indexterm>
  190. </listitem>
  191. </varlistentry>
  192. <varlistentry id="ex">
  193. <term><command>ex</command></term>
  194. <listitem>
  195. <para>Starts <command>vim</command> in ex mode</para>
  196. <indexterm zone="ch-system-vim ex">
  197. <primary sortas="b-ex">ex</primary>
  198. </indexterm>
  199. </listitem>
  200. </varlistentry>
  201. <varlistentry id="less.sh">
  202. <term><command>less.sh</command></term>
  203. <listitem>
  204. <para>A script that starts <command>vim</command> with less.vim</para>
  205. <indexterm zone="ch-system-vim less.sh">
  206. <primary sortas="b-less.sh">less.sh</primary>
  207. </indexterm>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="mve.awk">
  211. <term><command>mve.awk</command></term>
  212. <listitem>
  213. <para>Processes <command>vim</command> errors</para>
  214. <indexterm zone="ch-system-vim mve.awk">
  215. <primary sortas="b-mve.awk">mve.awk</primary>
  216. </indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="pltags.pl">
  220. <term><command>pltags.pl</command></term>
  221. <listitem>
  222. <para>Creates a tags file for Perl code for use by
  223. <command>vim</command></para>
  224. <indexterm zone="ch-system-vim pltags.pl">
  225. <primary sortas="b-pltags.pl">pltags.pl</primary>
  226. </indexterm>
  227. </listitem>
  228. </varlistentry>
  229. <varlistentry id="ref">
  230. <term><command>ref</command></term>
  231. <listitem>
  232. <para>Checks the spelling of arguments</para>
  233. <indexterm zone="ch-system-vim ref">
  234. <primary sortas="b-ref">ref</primary>
  235. </indexterm>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry id="rview">
  239. <term><command>rview</command></term>
  240. <listitem>
  241. <para>Is a restricted version of <command>view</command>; no shell
  242. commands can be started and <command>view</command> cannot be
  243. suspended</para>
  244. <indexterm zone="ch-system-vim rview">
  245. <primary sortas="b-rview">rview</primary>
  246. </indexterm>
  247. </listitem>
  248. </varlistentry>
  249. <varlistentry id="rvim">
  250. <term><command>rvim</command></term>
  251. <listitem>
  252. <para>Is a restricted version of <command>vim</command>; no shell
  253. commands can be started and <command>vim</command> cannot be
  254. suspended</para>
  255. <indexterm zone="ch-system-vim rvim">
  256. <primary sortas="b-rvim">rvim</primary>
  257. </indexterm>
  258. </listitem>
  259. </varlistentry>
  260. <varlistentry id="shtags.pl">
  261. <term><command>shtags.pl</command></term>
  262. <listitem>
  263. <para>Generates a tags file for Perl scripts</para>
  264. <indexterm zone="ch-system-vim shtags.pl">
  265. <primary sortas="b-shtags.pl">shtags.pl</primary>
  266. </indexterm>
  267. </listitem>
  268. </varlistentry>
  269. <varlistentry id="vi">
  270. <term><command>vi</command></term>
  271. <listitem>
  272. <para>Link to <command>vim</command></para>
  273. <indexterm zone="ch-system-vim vi">
  274. <primary sortas="b-vi">vi</primary>
  275. </indexterm>
  276. </listitem>
  277. </varlistentry>
  278. <varlistentry id="view">
  279. <term><command>view</command></term>
  280. <listitem>
  281. <para>Starts <command>vim</command> in read-only mode</para>
  282. <indexterm zone="ch-system-vim view">
  283. <primary sortas="b-view">view</primary>
  284. </indexterm>
  285. </listitem>
  286. </varlistentry>
  287. <varlistentry id="vim">
  288. <term><command>vim</command></term>
  289. <listitem>
  290. <para>Is the editor</para>
  291. <indexterm zone="ch-system-vim vim">
  292. <primary sortas="b-vim">vim</primary>
  293. </indexterm>
  294. </listitem>
  295. </varlistentry>
  296. <varlistentry id="vim132">
  297. <term><command>vim132</command></term>
  298. <listitem>
  299. <para>Starts <command>vim</command> with the terminal in 132-column
  300. mode</para>
  301. <indexterm zone="ch-system-vim vim132">
  302. <primary sortas="b-vim132">vim132</primary>
  303. </indexterm>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry id="vim2html.pl">
  307. <term><command>vim2html.pl</command></term>
  308. <listitem>
  309. <para>Converts Vim documentation to HypterText Markup Language
  310. (HTML)</para>
  311. <indexterm zone="ch-system-vim vim2html.pl">
  312. <primary sortas="b-vim2html.pl">vim2html.pl</primary>
  313. </indexterm>
  314. </listitem>
  315. </varlistentry>
  316. <varlistentry id="vimdiff">
  317. <term><command>vimdiff</command></term>
  318. <listitem>
  319. <para>Edits two or three versions of a file with <command>vim</command>
  320. and show differences</para>
  321. <indexterm zone="ch-system-vim vimdiff">
  322. <primary sortas="b-vimdiff">vimdiff</primary>
  323. </indexterm>
  324. </listitem>
  325. </varlistentry>
  326. <varlistentry id="vimm">
  327. <term><command>vimm</command></term>
  328. <listitem>
  329. <para>Enables the DEC locator input model on a remote terminal</para>
  330. <indexterm zone="ch-system-vim vimm">
  331. <primary sortas="b-vimm">vimm</primary>
  332. </indexterm>
  333. </listitem>
  334. </varlistentry>
  335. <varlistentry id="vimspell.sh">
  336. <term><command>vimspell.sh</command></term>
  337. <listitem>
  338. <para>Spell checks a file and generates the syntax statements
  339. necessary to highlight in <command>vim</command>. This script
  340. requires the old Unix <command>spell</command> command, which
  341. is provided neither in LFS nor in BLFS</para>
  342. <indexterm zone="ch-system-vim vimspell.sh">
  343. <primary sortas="b-vimspell.sh">vimspell.sh</primary>
  344. </indexterm>
  345. </listitem>
  346. </varlistentry>
  347. <varlistentry id="vimtutor">
  348. <term><command>vimtutor</command></term>
  349. <listitem>
  350. <para>Teaches the basic keys and commands of
  351. <command>vim</command></para>
  352. <indexterm zone="ch-system-vim vimtutor">
  353. <primary sortas="b-vimtutor">vimtutor</primary>
  354. </indexterm>
  355. </listitem>
  356. </varlistentry>
  357. <varlistentry id="xxd">
  358. <term><command>xxd</command></term>
  359. <listitem>
  360. <para>Creates a hex dump of the given file; it can
  361. also do the reverse, so it can be used for binary patching</para>
  362. <indexterm zone="ch-system-vim xxd">
  363. <primary sortas="b-xxd">xxd</primary>
  364. </indexterm>
  365. </listitem>
  366. </varlistentry>
  367. </variablelist>
  368. </sect2>
  369. </sect1>