vim.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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">
  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. <para>The Vim package contains a powerful text editor.</para>
  11. <screen>&buildtime; 0.4 SBU
  12. &diskspace; 34 MB</screen>
  13. <para>Vim installation depends on: Bash, Binutils, Coreutils, Diffutils,
  14. GCC, Glibc, Grep, Make, Ncurses, Sed.</para>
  15. <sect2>
  16. <title>Alternatives to Vim</title>
  17. <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
  18. have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
  19. suggested installation instructions.</para>
  20. </sect2>
  21. <sect2>
  22. <title>Installation of Vim</title>
  23. <para>First change the default locations of the <filename>vimrc</filename> and
  24. <filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
  25. <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
  26. echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
  27. <para>Now prepare Vim for compilation:</para>
  28. <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
  29. <para>The optional <userinput>--enable-multibyte</userinput> switch
  30. includes multibyte editing support into
  31. vim. It is only needed for those people who ignore our recommendation not to
  32. use LFS in locales with multibyte character sets, but it does not hurt
  33. others.</para>
  34. <para>Compile the package:</para>
  35. <screen><userinput>make</userinput></screen>
  36. <para>To test the results, you can issue:
  37. <userinput>make test</userinput>. However, this test suite outputs a lot of
  38. seemingly garbage characters to the screen, and this can wreak havoc with the
  39. settings of the current terminal. Therefore the running of the test suite here
  40. is strictly optional.</para>
  41. <para>Now install the package:</para>
  42. <screen><userinput>make install</userinput></screen>
  43. <para>Many users are used to using <command>vi</command>, instead of
  44. <command>vim</command>. To let them execute <command>vim</command> when
  45. they habitually enter <command>vi</command>, create a symlink:</para>
  46. <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
  47. <para>If you are going to install the X Window system on your LFS system, you
  48. may want to re-compile Vim after having installed X. Vim comes with a nice GUI
  49. version of the editor that requires X and a few other libraries to be
  50. installed. For more information read the Vim documentation.</para>
  51. </sect2>
  52. <sect2 id="conf-vim"><title>Configuring Vim</title>
  53. <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
  54. <para>By default, <command>vim</command> runs in vi-incompatible mode. Some
  55. people might not like this, but we prefer to run <command>vim</command> in its
  56. own mode (else we wouldn't have included it in this book, but the original
  57. <command>vi</command>). We've included the setting of "nocompatible"
  58. below to high-light the fact that the new behavior is being used. It
  59. also reminds those who would change to "compatible" mode that it should
  60. appear first because it changes other settings and overrides must come
  61. after this setting. Create a default vim configuration file by running
  62. the following:</para>
  63. <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
  64. " Begin /etc/vimrc
  65. set nocompatible
  66. set backspace=2
  67. syntax on
  68. " End /etc/vimrc
  69. <userinput>EOF</userinput></screen>
  70. <para>The <emphasis>set nocompatible</emphasis> makes
  71. <command>vim</command> behave in a more useful way (the default) than the
  72. vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
  73. behavior. The <emphasis>set backspace=2</emphasis> allows
  74. backspacing over line breaks, autoindents and the start of insert. The
  75. <emphasis>syntax on</emphasis> enables <command>vim</command>'s
  76. semantic coloring.</para>
  77. <para>Documentation for other available options can be obtained by running
  78. the following command:</para>
  79. <screen><userinput>vim -c ':options'</userinput></screen>
  80. </sect2>
  81. <sect2 id="contents-vim"><title>Contents of Vim</title>
  82. <para><emphasis>Installed programs</emphasis>: efm_filter.pl, efm_perl.pl, ex
  83. (link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim
  84. (link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim,
  85. vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor
  86. and xxd</para>
  87. </sect2>
  88. <sect2><title>Short descriptions</title>
  89. <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
  90. <para id="efm_filter.pl"><command>efm_filter.pl</command> is a filter for creating an error
  91. file that can be read by vim.</para>
  92. <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
  93. <para id="efm_perl.pl"><command>efm_perl.pl</command> reformats the error messages of the
  94. Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
  95. <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
  96. <para id="ex"><command>ex</command> starts vim in ex mode.</para>
  97. <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
  98. <para id="less.sh"><command>less.sh</command> is a script that starts vim with less.vim.</para>
  99. <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
  100. <para id="mve.awk"><command>mve.awk</command> processes vim errors.</para>
  101. <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
  102. <para id="pltags.pl"><command>pltags.pl</command> creates a tags file for perl code,
  103. for use by vim.</para>
  104. <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
  105. <para id="ref"><command>ref</command> checks the spelling of arguments.</para>
  106. <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
  107. <para id="rview"><command>rview</command> is a restricted version of view: no shell
  108. commands can be started and view can't be suspended.</para>
  109. <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
  110. <para id="rvim"><command>rvim</command> is a restricted version of vim: no shell
  111. commands can be started and vim can't be suspended.</para>
  112. <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
  113. <para id="shtags.pl"><command>shtags.pl</command> generates a tag file for perl scripts.</para>
  114. <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
  115. <para id="tcltags"><command>tcltags</command> generates a tag file for TCL code.</para>
  116. <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
  117. <para id="view"><command>view</command> starts vim in read-only mode.</para>
  118. <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
  119. <para id="vim"><command>vim</command> is the editor.</para>
  120. <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
  121. <para id="vim132"><command>vim132</command> starts vim with the terminal in
  122. 132-column mode.</para>
  123. <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
  124. <para id="vim2html.pl"><command>vim2html.pl</command> converts vim documentation to
  125. HTML.</para>
  126. <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
  127. <para id="vimdiff"><command>vimdiff</command> edits two or three versions of a file with
  128. vim and show differences.</para>
  129. <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
  130. <para id="vimm"><command>vimm</command> enables the DEC locator input model on a
  131. remote terminal.</para>
  132. <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
  133. <para id="vimspell.sh"><command>vimspell.sh</command> is a script which spells a file and generates the syntax
  134. statements necessary to highlight in vim.
  135. This script requires the old Unix <command>spell</command> command,
  136. which is provided neither in LFS nor in BLFS.</para>
  137. <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
  138. <para id="vimtutor"><command>vimtutor</command> teaches you the basic keys and commands
  139. of vim.</para>
  140. <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
  141. <para id="xxd"><command>xxd</command> makes a hex dump of the given file. It can
  142. also do the reverse, so it can be used for binary patching.</para>
  143. </sect2>
  144. </sect1>