vim.xml 15 KB

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