vim.xml 15 KB

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