vim.xml 13 KB

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