vim.xml 15 KB

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