vim.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-vim" xreflabel="Vim" role="wrap">
  7. <title>Vim-&vim-version;</title>
  8. <?dbhtml filename="vim.html"?>
  9. <indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Vim package contains a powerful text editor.</para>
  12. <segmentedlist>
  13. <segtitle>&buildtime;</segtitle>
  14. <segtitle>&diskspace;</segtitle>
  15. <seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem>
  16. </segmentedlist>
  17. <segmentedlist>
  18. <segtitle>Vim installation depends on</segtitle>
  19. <seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
  20. GCC, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem>
  21. </segmentedlist>
  22. <tip>
  23. <title>Alternatives to Vim</title>
  24. <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
  25. have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
  26. suggested installation instructions.</para>
  27. </tip>
  28. </sect2>
  29. <sect2 role="installation">
  30. <title>Installation of Vim</title>
  31. <para>First change the default locations of the <filename>vimrc</filename> and
  32. <filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
  33. <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
  34. echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
  35. <para>Now prepare Vim for compilation:</para>
  36. <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
  37. <para>The optional <userinput>--enable-multibyte</userinput> switch
  38. includes multibyte editing support into
  39. vim. It is only needed for those people who ignore our recommendation not to
  40. use LFS in locales with multibyte character sets, but it does not hurt
  41. others.</para>
  42. <para>Compile the package:</para>
  43. <screen><userinput>make</userinput></screen>
  44. <para>To test the results, you can issue:
  45. <userinput>make test</userinput>. However, this test suite outputs a lot of
  46. seemingly garbage characters to the screen, and this can wreak havoc with the
  47. settings of the current terminal. Therefore the running of the test suite here
  48. is strictly optional.</para>
  49. <para>Now install the package:</para>
  50. <screen><userinput>make install</userinput></screen>
  51. <para>Many users are used to using <command>vi</command>, instead of
  52. <command>vim</command>. To let them execute <command>vim</command> when
  53. they habitually enter <command>vi</command>, create a symlink:</para>
  54. <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
  55. <para>If you are going to install the X Window system on your LFS system, you
  56. may want to re-compile Vim after having installed X. Vim comes with a nice GUI
  57. version of the editor that requires X and a few other libraries to be
  58. installed. For more information read the Vim documentation.</para>
  59. </sect2>
  60. <sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
  61. <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
  62. <para>By default, <command>vim</command> runs in vi-incompatible mode. Some
  63. people might not like this, but we prefer to run <command>vim</command> in its
  64. own mode (else we wouldn't have included it in this book, but the original
  65. <command>vi</command>). We've included the setting of "nocompatible"
  66. below to high-light the fact that the new behavior is being used. It
  67. also reminds those who would change to "compatible" mode that it should
  68. appear first because it changes other settings and overrides must come
  69. after this setting. Create a default vim configuration file by running
  70. the following:</para>
  71. <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
  72. " Begin /etc/vimrc
  73. set nocompatible
  74. set backspace=2
  75. syntax on
  76. set background=dark
  77. " End /etc/vimrc
  78. <userinput>EOF</userinput></screen>
  79. <para>The <emphasis>set nocompatible</emphasis> makes
  80. <command>vim</command> behave in a more useful way (the default) than the
  81. vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
  82. behavior. The <emphasis>set backspace=2</emphasis> allows
  83. backspacing over line breaks, autoindents and the start of insert. The
  84. <emphasis>syntax on</emphasis> enables <command>vim</command>'s
  85. syntax highliting, while <emphasis>set background=dark</emphasis> gives the
  86. highliting a better color scheme for use on the black background of a linux
  87. console. If you later use X and terminals with a light background, changing
  88. this will be useful.</para>
  89. <para>Documentation for other available options can be obtained by running
  90. the following command:</para>
  91. <screen><userinput>vim -c ':options'</userinput></screen>
  92. </sect2>
  93. <sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
  94. <segmentedlist>
  95. <segtitle>Installed programs</segtitle>
  96. <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
  97. pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
  98. view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
  99. vimtutor and xxd</seg></seglistitem>
  100. </segmentedlist>
  101. <variablelist><title>Short descriptions</title>
  102. <varlistentry id="efm_filter.pl">
  103. <term><command>efm_filter.pl</command></term>
  104. <listitem>
  105. <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
  106. <para>is a filter for creating an error file that can be read by vim.</para>
  107. </listitem>
  108. </varlistentry>
  109. <varlistentry id="efm_perl.pl">
  110. <term><command>efm_perl.pl</command></term>
  111. <listitem>
  112. <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
  113. <para>reformats the error messages of the
  114. Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry id="ex">
  118. <term><command>ex</command></term>
  119. <listitem>
  120. <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
  121. <para>starts vim in ex mode.</para>
  122. </listitem>
  123. </varlistentry>
  124. <varlistentry id="less.sh">
  125. <term><command>less.sh</command></term>
  126. <listitem>
  127. <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
  128. <para>is a script that starts vim with less.vim.</para>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry id="mve.awk">
  132. <term><command>mve.awk</command></term>
  133. <listitem>
  134. <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
  135. <para>processes vim errors.</para>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry id="pltags.pl">
  139. <term><command>pltags.pl</command></term>
  140. <listitem>
  141. <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
  142. <para>creates a tags file for perl code, for use by vim.</para>
  143. </listitem>
  144. </varlistentry>
  145. <varlistentry id="ref">
  146. <term><command>ref</command></term>
  147. <listitem>
  148. <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
  149. <para>checks the spelling of arguments.</para>
  150. </listitem>
  151. </varlistentry>
  152. <varlistentry id="rview">
  153. <term><command>rview</command></term>
  154. <listitem>
  155. <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
  156. <para>is a restricted version of view: no shell
  157. commands can be started and view can't be suspended.</para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry id="rvim">
  161. <term><command>rvim</command></term>
  162. <listitem>
  163. <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
  164. <para>is a restricted version of vim: no shell
  165. commands can be started and vim can't be suspended.</para>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry id="shtags.pl">
  169. <term><command>shtags.pl</command></term>
  170. <listitem>
  171. <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
  172. <para>generates a tag file for perl scripts.</para>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry id="tcltags">
  176. <term><command>tcltags</command></term>
  177. <listitem>
  178. <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
  179. <para>generates a tag file for TCL code.</para>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry id="view">
  183. <term><command>view</command></term>
  184. <listitem>
  185. <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
  186. <para>starts vim in read-only mode.</para>
  187. </listitem>
  188. </varlistentry>
  189. <varlistentry id="vim">
  190. <term><command>vim</command></term>
  191. <listitem>
  192. <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
  193. <para>is the editor.</para>
  194. </listitem>
  195. </varlistentry>
  196. <varlistentry id="vim132">
  197. <term><command>vim132</command></term>
  198. <listitem>
  199. <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
  200. <para>starts vim with the terminal in 132-column mode.</para>
  201. </listitem>
  202. </varlistentry>
  203. <varlistentry id="vim2html.pl">
  204. <term><command>vim2html.pl</command></term>
  205. <listitem>
  206. <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
  207. <para>converts vim documentation to HTML.</para>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="vimdiff">
  211. <term><command>vimdiff</command></term>
  212. <listitem>
  213. <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
  214. <para>edits two or three versions of a file with vim and show differences.</para>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="vimm">
  218. <term><command>vimm</command></term>
  219. <listitem>
  220. <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
  221. <para>enables the DEC locator input model on a remote terminal.</para>
  222. </listitem>
  223. </varlistentry>
  224. <varlistentry id="vimspell.sh">
  225. <term><command>vimspell.sh</command></term>
  226. <listitem>
  227. <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
  228. <para>is a script which spells a file and generates the syntax statements necessary
  229. to highlight in vim. This script requires the old Unix <command>spell</command>
  230. command, which is provided neither in LFS nor in BLFS.</para>
  231. </listitem>
  232. </varlistentry>
  233. <varlistentry id="vimtutor">
  234. <term><command>vimtutor</command></term>
  235. <listitem>
  236. <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
  237. <para>teaches you the basic keys and commands of vim.</para>
  238. </listitem>
  239. </varlistentry>
  240. <varlistentry id="xxd">
  241. <term><command>xxd</command></term>
  242. <listitem>
  243. <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
  244. <para>makes a hex dump of the given file. It can
  245. also do the reverse, so it can be used for binary patching.</para>
  246. </listitem>
  247. </varlistentry>
  248. </variablelist>
  249. </sect2>
  250. </sect1>