vim.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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>Vim has two known security vulnerabilities that have already been
  41. addressed upstream. The following patch fixes the problems:</para>
  42. <screen><userinput>patch -Np1 -i ../&vim-security_fix-patch;</userinput></screen>
  43. <para>Now prepare Vim for compilation:</para>
  44. <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
  45. <para>The meaning of the configure options:</para>
  46. <variablelist>
  47. <varlistentry>
  48. <term><parameter>--enable-multibyte</parameter></term>
  49. <listitem><para>This optional but highly recommended switch enables support for
  50. editing files in multibyte character encodings. This is needed if using a
  51. locale with a multibyte character set. This switch is also helpful to be able to
  52. edit text files initially created in Linux distributions like Fedora Core that
  53. use UTF-8 as a default character set.</para>
  54. </listitem>
  55. </varlistentry>
  56. </variablelist>
  57. <para>Compile the package:</para>
  58. <screen><userinput>make</userinput></screen>
  59. <para>To test the results, issue: <userinput>make test</userinput>. However,
  60. this test suite outputs a lot of binary data to the screen, which can cause
  61. issues with the settings of the current terminal. This can be resolved by
  62. redirecting the output to a log file.</para>
  63. <para>Install the package:</para>
  64. <screen><userinput>make install</userinput></screen>
  65. <para>Many users are used to using <command>vi</command> instead of
  66. <command>vim</command>. To allow execution of <command>vim</command>
  67. when users habitually enter <command>vi</command>, create a
  68. symlink:</para>
  69. <screen><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
  70. <para>If an X Window System is going to be installed on the LFS
  71. system, it may be necessary to recompile Vim after installing X. Vim
  72. comes with a GUI version of the editor that requires X and some
  73. additional libraries to be installed. For more information on this
  74. process, refer to the Vim documentation and the Vim installation page
  75. in the BLFS book at <ulink
  76. url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
  77. </sect2>
  78. <sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
  79. <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
  80. <para>By default, <command>vim</command> runs in vi-incompatible mode. This may
  81. be new to users who have used other editors in the past. The
  82. <quote>nocompatible</quote> setting is included below to highlight the fact that
  83. a new behavior is being used. It also reminds those who would change to
  84. <quote>compatible</quote> mode that it should be the first setting in the
  85. configuration file. This is necessary because it changes other settings, and
  86. overrides must come after this setting. Create a default <command>vim</command>
  87. configuration file by running the following:</para>
  88. <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
  89. <literal>" Begin /etc/vimrc
  90. set nocompatible
  91. set backspace=2
  92. syntax on
  93. if (&amp;term == "iterm") || (&amp;term == "putty")
  94. set background=dark
  95. endif
  96. " End /etc/vimrc</literal>
  97. EOF</userinput></screen>
  98. <para>The <parameter>set nocompatible</parameter> makes
  99. <command>vim</command> behave in a more useful way (the default) than
  100. the vi-compatible manner. Remove the <quote>no</quote> to keep the
  101. old <command>vi</command> behavior. The <parameter>set
  102. backspace=2</parameter> allows backspacing over line breaks,
  103. autoindents, and the start of insert. The <parameter>syntax
  104. on</parameter> enables vim's syntax highlighting. Finally, the
  105. <emphasis>if</emphasis> statement with the <parameter>set
  106. background=dark</parameter> corrects <command>vim</command>'s guess
  107. about the background color of some terminal emulators. This gives the
  108. highlighting a better color scheme for use on the black background of
  109. these programs.</para>
  110. <para>Documentation for other available options can be obtained by
  111. running the following command:</para>
  112. <screen><userinput>vim -c ':options'</userinput></screen>
  113. </sect2>
  114. <sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
  115. <segmentedlist>
  116. <segtitle>Installed programs</segtitle>
  117. <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
  118. pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
  119. view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
  120. vimtutor, and xxd</seg></seglistitem>
  121. </segmentedlist>
  122. <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
  123. <?dbfo list-presentation="list"?>
  124. <?dbhtml list-presentation="table"?>
  125. <varlistentry id="efm_filter.pl">
  126. <term><command>efm_filter.pl</command></term>
  127. <listitem>
  128. <para>A filter for creating an error file that can be read by <command>vim</command></para>
  129. <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
  130. </listitem>
  131. </varlistentry>
  132. <varlistentry id="efm_perl.pl">
  133. <term><command>efm_perl.pl</command></term>
  134. <listitem>
  135. <para>Reformats the error messages of the
  136. Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command></para>
  137. <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
  138. </listitem>
  139. </varlistentry>
  140. <varlistentry id="ex">
  141. <term><command>ex</command></term>
  142. <listitem>
  143. <para>Starts <command>vim</command> in ex mode</para>
  144. <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
  145. </listitem>
  146. </varlistentry>
  147. <varlistentry id="less.sh">
  148. <term><command>less.sh</command></term>
  149. <listitem>
  150. <para>A script that starts <command>vim</command> with less.vim</para>
  151. <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
  152. </listitem>
  153. </varlistentry>
  154. <varlistentry id="mve.awk">
  155. <term><command>mve.awk</command></term>
  156. <listitem>
  157. <para>Processes <command>vim</command> errors</para>
  158. <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="pltags.pl">
  162. <term><command>pltags.pl</command></term>
  163. <listitem>
  164. <para>Creates a tags file for Perl code for use by <command>vim</command></para>
  165. <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry id="ref">
  169. <term><command>ref</command></term>
  170. <listitem>
  171. <para>Checks the spelling of arguments</para>
  172. <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry id="rview">
  176. <term><command>rview</command></term>
  177. <listitem>
  178. <para>Is a restricted version of <command>view</command>; no shell
  179. commands can be started and <command>view</command> cannot be suspended</para>
  180. <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
  181. </listitem>
  182. </varlistentry>
  183. <varlistentry id="rvim">
  184. <term><command>rvim</command></term>
  185. <listitem>
  186. <para>Is a restricted version of <command>vim</command>; no shell
  187. commands can be started and <command>vim</command> cannot be suspended</para>
  188. <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
  189. </listitem>
  190. </varlistentry>
  191. <varlistentry id="shtags.pl">
  192. <term><command>shtags.pl</command></term>
  193. <listitem>
  194. <para>Generates a tags file for Perl scripts</para>
  195. <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
  196. </listitem>
  197. </varlistentry>
  198. <varlistentry id="tcltags">
  199. <term><command>tcltags</command></term>
  200. <listitem>
  201. <para>Generates a tags file for TCL code</para>
  202. <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
  203. </listitem>
  204. </varlistentry>
  205. <varlistentry id="view">
  206. <term><command>view</command></term>
  207. <listitem>
  208. <para>Starts <command>vim</command> in read-only mode</para>
  209. <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
  210. </listitem>
  211. </varlistentry>
  212. <varlistentry id="vi">
  213. <term><command>vi</command></term>
  214. <listitem>
  215. <para>Is the editor</para>
  216. <indexterm zone="ch-system-vim vi"><primary sortas="b-vi">vi</primary></indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="vim">
  220. <term><command>vim</command></term>
  221. <listitem>
  222. <para>Is the editor</para>
  223. <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
  224. </listitem>
  225. </varlistentry>
  226. <varlistentry id="vim132">
  227. <term><command>vim132</command></term>
  228. <listitem>
  229. <para>Starts <command>vim</command> with the terminal in 132-column mode</para>
  230. <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
  231. </listitem>
  232. </varlistentry>
  233. <varlistentry id="vim2html.pl">
  234. <term><command>vim2html.pl</command></term>
  235. <listitem>
  236. <para>Converts Vim documentation to HypterText Markup Language (HTML)</para>
  237. <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
  238. </listitem>
  239. </varlistentry>
  240. <varlistentry id="vimdiff">
  241. <term><command>vimdiff</command></term>
  242. <listitem>
  243. <para>Edits two or three versions of a file with <command>vim</command> and show differences</para>
  244. <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
  245. </listitem>
  246. </varlistentry>
  247. <varlistentry id="vimm">
  248. <term><command>vimm</command></term>
  249. <listitem>
  250. <para>Enables the DEC locator input model on a remote terminal</para>
  251. <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="vimspell.sh">
  255. <term><command>vimspell.sh</command></term>
  256. <listitem>
  257. <para>Spell checks a file and generates the syntax statements necessary to
  258. highlight in <command>vim</command>. This script requires the old Unix
  259. <command>spell</command> command, which is provided neither in LFS nor in
  260. BLFS</para>
  261. <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
  262. </listitem>
  263. </varlistentry>
  264. <varlistentry id="vimtutor">
  265. <term><command>vimtutor</command></term>
  266. <listitem>
  267. <para>Teaches the basic keys and commands of <command>vim</command></para>
  268. <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
  269. </listitem>
  270. </varlistentry>
  271. <varlistentry id="xxd">
  272. <term><command>xxd</command></term>
  273. <listitem>
  274. <para>Creates a hex dump of the given file; it can
  275. also do the reverse, so it can be used for binary patching</para>
  276. <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
  277. </listitem>
  278. </varlistentry>
  279. </variablelist>
  280. </sect2>
  281. </sect1>