vim.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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, unpack both
  32. <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
  33. <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the same
  34. directory. Then change the default locations of the <filename>vimrc</filename> and
  35. <filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
  36. <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
  37. echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
  38. <para>Now prepare Vim for compilation:</para>
  39. <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
  40. <para>The optional but highly recommended
  41. <userinput>--enable-multibyte</userinput> switch
  42. includes support for editing files in multibyte character encodings into
  43. vim. It is needed for those people who ignore our recommendation not to
  44. use LFS in locales with multibyte character sets. It is also needed for
  45. people who want to be able to edit text files initially created
  46. in Linux distributions like Fedora Core
  47. that use UTF-8 as a default character set.</para>
  48. <para>Compile the package:</para>
  49. <screen><userinput>make</userinput></screen>
  50. <para>To test the results, you can issue:
  51. <userinput>make test</userinput>. However, this test suite outputs a lot of
  52. seemingly garbage characters to the screen, and this can wreak havoc with the
  53. settings of the current terminal. Therefore the running of the test suite here
  54. is strictly optional.</para>
  55. <para>Now install the package:</para>
  56. <screen><userinput>make install</userinput></screen>
  57. <para>Many users are used to using <command>vi</command>, instead of
  58. <command>vim</command>. To let them execute <command>vim</command> when
  59. they habitually enter <command>vi</command>, create a symlink:</para>
  60. <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
  61. <para>If you are going to install the X Window system on your LFS system, you
  62. may want to re-compile Vim after having installed X. Vim comes with a nice GUI
  63. version of the editor that requires X and a few other libraries to be
  64. installed. For more information read the Vim documentation.</para>
  65. </sect2>
  66. <sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
  67. <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
  68. <para>By default, <command>vim</command> runs in vi-incompatible mode. Some
  69. people might not like this, but we prefer to run <command>vim</command> in its
  70. own mode (else we wouldn't have included it in this book, but the original
  71. <command>vi</command>). We've included the setting of "nocompatible"
  72. below to high-light the fact that the new behavior is being used. It
  73. also reminds those who would change to "compatible" mode that it should
  74. appear first because it changes other settings and overrides must come
  75. after this setting. Create a default vim configuration file by running
  76. the following:</para>
  77. <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
  78. " Begin /etc/vimrc
  79. set nocompatible
  80. set backspace=2
  81. syntax on
  82. set background=dark
  83. set fileencodings=ucs-bom,utf-8,<replaceable>your-8-bit-charset</replaceable>
  84. " End /etc/vimrc
  85. <userinput>EOF</userinput></screen>
  86. <para>The <emphasis>set nocompatible</emphasis> makes
  87. <command>vim</command> behave in a more useful way (the default) than the
  88. vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
  89. behavior. The <emphasis>set backspace=2</emphasis> allows
  90. backspacing over line breaks, autoindents and the start of insert. The
  91. <emphasis>syntax on</emphasis> enables <command>vim</command>'s
  92. syntax highliting, while <emphasis>set background=dark</emphasis> gives the
  93. highliting a better color scheme for use on the black background of a linux
  94. console. If you later use X and terminals with a light background, changing
  95. this will be useful. The <emphasis>set fileencodings=...</emphasis> makes
  96. <command>vim</command> capable of detecting the character set of the
  97. file being edited. This is useful because bleeding-edge distributions
  98. like Fedora Core use UTF-8, and conservative ones like Debian
  99. use traditional 8-bit encodings for text files. If you have not
  100. passed the <option>--enable-multibyte</option> switch to the
  101. <command>./configure</command> command above, this line will not work.
  102. </para>
  103. <para>Documentation for other available options can be obtained by running
  104. the following command:</para>
  105. <screen><userinput>vim -c ':options'</userinput></screen>
  106. </sect2>
  107. <sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
  108. <segmentedlist>
  109. <segtitle>Installed programs</segtitle>
  110. <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
  111. pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
  112. view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
  113. vimtutor and xxd</seg></seglistitem>
  114. </segmentedlist>
  115. <variablelist><title>Short descriptions</title>
  116. <varlistentry id="efm_filter.pl">
  117. <term><command>efm_filter.pl</command></term>
  118. <listitem>
  119. <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
  120. <para>is a filter for creating an error file that can be read by vim.</para>
  121. </listitem>
  122. </varlistentry>
  123. <varlistentry id="efm_perl.pl">
  124. <term><command>efm_perl.pl</command></term>
  125. <listitem>
  126. <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
  127. <para>reformats the error messages of the
  128. Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry id="ex">
  132. <term><command>ex</command></term>
  133. <listitem>
  134. <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
  135. <para>starts vim in ex mode.</para>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry id="less.sh">
  139. <term><command>less.sh</command></term>
  140. <listitem>
  141. <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
  142. <para>is a script that starts vim with less.vim.</para>
  143. </listitem>
  144. </varlistentry>
  145. <varlistentry id="mve.awk">
  146. <term><command>mve.awk</command></term>
  147. <listitem>
  148. <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
  149. <para>processes vim errors.</para>
  150. </listitem>
  151. </varlistentry>
  152. <varlistentry id="pltags.pl">
  153. <term><command>pltags.pl</command></term>
  154. <listitem>
  155. <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
  156. <para>creates a tags file for perl code, for use by vim.</para>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry id="ref">
  160. <term><command>ref</command></term>
  161. <listitem>
  162. <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
  163. <para>checks the spelling of arguments.</para>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="rview">
  167. <term><command>rview</command></term>
  168. <listitem>
  169. <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
  170. <para>is a restricted version of view: no shell
  171. commands can be started and view can't be suspended.</para>
  172. </listitem>
  173. </varlistentry>
  174. <varlistentry id="rvim">
  175. <term><command>rvim</command></term>
  176. <listitem>
  177. <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
  178. <para>is a restricted version of vim: no shell
  179. commands can be started and vim can't be suspended.</para>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry id="shtags.pl">
  183. <term><command>shtags.pl</command></term>
  184. <listitem>
  185. <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
  186. <para>generates a tag file for perl scripts.</para>
  187. </listitem>
  188. </varlistentry>
  189. <varlistentry id="tcltags">
  190. <term><command>tcltags</command></term>
  191. <listitem>
  192. <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
  193. <para>generates a tag file for TCL code.</para>
  194. </listitem>
  195. </varlistentry>
  196. <varlistentry id="view">
  197. <term><command>view</command></term>
  198. <listitem>
  199. <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
  200. <para>starts vim in read-only mode.</para>
  201. </listitem>
  202. </varlistentry>
  203. <varlistentry id="vim">
  204. <term><command>vim</command></term>
  205. <listitem>
  206. <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
  207. <para>is the editor.</para>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="vim132">
  211. <term><command>vim132</command></term>
  212. <listitem>
  213. <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
  214. <para>starts vim with the terminal in 132-column mode.</para>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="vim2html.pl">
  218. <term><command>vim2html.pl</command></term>
  219. <listitem>
  220. <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
  221. <para>converts vim documentation to HTML.</para>
  222. </listitem>
  223. </varlistentry>
  224. <varlistentry id="vimdiff">
  225. <term><command>vimdiff</command></term>
  226. <listitem>
  227. <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
  228. <para>edits two or three versions of a file with vim and show differences.</para>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="vimm">
  232. <term><command>vimm</command></term>
  233. <listitem>
  234. <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
  235. <para>enables the DEC locator input model on a remote terminal.</para>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry id="vimspell.sh">
  239. <term><command>vimspell.sh</command></term>
  240. <listitem>
  241. <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
  242. <para>is a script which spells a file and generates the syntax statements necessary
  243. to highlight in vim. This script requires the old Unix <command>spell</command>
  244. command, which is provided neither in LFS nor in BLFS.</para>
  245. </listitem>
  246. </varlistentry>
  247. <varlistentry id="vimtutor">
  248. <term><command>vimtutor</command></term>
  249. <listitem>
  250. <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
  251. <para>teaches you the basic keys and commands of vim.</para>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="xxd">
  255. <term><command>xxd</command></term>
  256. <listitem>
  257. <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
  258. <para>makes a hex dump of the given file. It can
  259. also do the reverse, so it can be used for binary patching.</para>
  260. </listitem>
  261. </varlistentry>
  262. </variablelist>
  263. </sect2>
  264. </sect1>