vim.xml 16 KB

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