vim.xml 16 KB

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