vim.xml 15 KB

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