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