vim.xml 12 KB

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