vim.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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>This version of Vim installs translated man pages and places
  39. them into directories that will not be searched by Man-DB. Patch Vim
  40. so that it installs its man pages into searchable directories and
  41. ultimately allows Man-DB to transcode the page into the desired format
  42. at run-time:</para>
  43. <screen><userinput>patch -Np1 -i ../&vim-mandir-patch;</userinput></screen>
  44. <para>Finally, 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>Many users are used to using <command>vi</command> instead of
  72. <command>vim</command>. To allow execution of <command>vim</command>
  73. when users habitually enter <command>vi</command>, create a
  74. symlink for both the binary and the man page in the provided
  75. languages:</para>
  76. <screen><userinput>ln -sv vim /usr/bin/vi
  77. for L in "" fr it pl ru; do
  78. ln -sv vim.1 /usr/share/man/$L/man1/vi.1
  79. done</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-docdir;/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> setting 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> setting allows backspacing over line breaks,
  122. autoindents, and the start of insert. The <parameter>syntax
  123. on</parameter> parameter enables vim's syntax highlighting. Finally,
  124. the <emphasis>if</emphasis> statement with the <parameter>set
  125. background=dark</parameter> setting corrects <command>vim</command>'s
  126. guess about the background color of some terminal emulators. This
  127. gives the highlighting a better color scheme for use on the black
  128. background of 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. <note>
  133. <para>By default, Vim only installs spell files for the English language.
  134. To install spell files for your preferred language, download the
  135. <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
  136. files for your language and character encoding from <ulink
  137. url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
  138. <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
  139. <para>To use these spell files, some configuration in
  140. <filename>/etc/vimrc</filename> is needed, e.g.:</para>
  141. <screen><literal>set spelllang=en,ru
  142. set spell</literal></screen>
  143. <para>For more information, see the appropriate README file located
  144. at the URL above.</para>
  145. </note>
  146. </sect2>
  147. <sect2 id="contents-vim" role="content">
  148. <title>Contents of Vim</title>
  149. <segmentedlist>
  150. <segtitle>Installed programs</segtitle>
  151. <seglistitem>
  152. <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
  153. pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
  154. vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
  155. vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
  156. </seglistitem>
  157. </segmentedlist>
  158. <variablelist>
  159. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  160. <?dbfo list-presentation="list"?>
  161. <?dbhtml list-presentation="table"?>
  162. <varlistentry id="efm_filter.pl">
  163. <term><command>efm_filter.pl</command></term>
  164. <listitem>
  165. <para>A filter for creating an error file that can be read
  166. by <command>vim</command></para>
  167. <indexterm zone="ch-system-vim efm_filter.pl">
  168. <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
  169. </indexterm>
  170. </listitem>
  171. </varlistentry>
  172. <varlistentry id="efm_perl.pl">
  173. <term><command>efm_perl.pl</command></term>
  174. <listitem>
  175. <para>Reformats the error messages of the Perl interpreter for use
  176. with the <quote>quickfix</quote> mode of <command>vim</command></para>
  177. <indexterm zone="ch-system-vim efm_perl.pl">
  178. <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
  179. </indexterm>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry id="ex">
  183. <term><command>ex</command></term>
  184. <listitem>
  185. <para>Starts <command>vim</command> in ex mode</para>
  186. <indexterm zone="ch-system-vim ex">
  187. <primary sortas="b-ex">ex</primary>
  188. </indexterm>
  189. </listitem>
  190. </varlistentry>
  191. <varlistentry id="less.sh">
  192. <term><command>less.sh</command></term>
  193. <listitem>
  194. <para>A script that starts <command>vim</command> with less.vim</para>
  195. <indexterm zone="ch-system-vim less.sh">
  196. <primary sortas="b-less.sh">less.sh</primary>
  197. </indexterm>
  198. </listitem>
  199. </varlistentry>
  200. <varlistentry id="mve.awk">
  201. <term><command>mve.awk</command></term>
  202. <listitem>
  203. <para>Processes <command>vim</command> errors</para>
  204. <indexterm zone="ch-system-vim mve.awk">
  205. <primary sortas="b-mve.awk">mve.awk</primary>
  206. </indexterm>
  207. </listitem>
  208. </varlistentry>
  209. <varlistentry id="pltags.pl">
  210. <term><command>pltags.pl</command></term>
  211. <listitem>
  212. <para>Creates a tags file for Perl code for use by
  213. <command>vim</command></para>
  214. <indexterm zone="ch-system-vim pltags.pl">
  215. <primary sortas="b-pltags.pl">pltags.pl</primary>
  216. </indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="ref">
  220. <term><command>ref</command></term>
  221. <listitem>
  222. <para>Checks the spelling of arguments</para>
  223. <indexterm zone="ch-system-vim ref">
  224. <primary sortas="b-ref">ref</primary>
  225. </indexterm>
  226. </listitem>
  227. </varlistentry>
  228. <varlistentry id="rview">
  229. <term><command>rview</command></term>
  230. <listitem>
  231. <para>Is a restricted version of <command>view</command>; no shell
  232. commands can be started and <command>view</command> cannot be
  233. suspended</para>
  234. <indexterm zone="ch-system-vim rview">
  235. <primary sortas="b-rview">rview</primary>
  236. </indexterm>
  237. </listitem>
  238. </varlistentry>
  239. <varlistentry id="rvim">
  240. <term><command>rvim</command></term>
  241. <listitem>
  242. <para>Is a restricted version of <command>vim</command>; no shell
  243. commands can be started and <command>vim</command> cannot be
  244. suspended</para>
  245. <indexterm zone="ch-system-vim rvim">
  246. <primary sortas="b-rvim">rvim</primary>
  247. </indexterm>
  248. </listitem>
  249. </varlistentry>
  250. <varlistentry id="shtags.pl">
  251. <term><command>shtags.pl</command></term>
  252. <listitem>
  253. <para>Generates a tags file for Perl scripts</para>
  254. <indexterm zone="ch-system-vim shtags.pl">
  255. <primary sortas="b-shtags.pl">shtags.pl</primary>
  256. </indexterm>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry id="vi">
  260. <term><command>vi</command></term>
  261. <listitem>
  262. <para>Link to <command>vim</command></para>
  263. <indexterm zone="ch-system-vim vi">
  264. <primary sortas="b-vi">vi</primary>
  265. </indexterm>
  266. </listitem>
  267. </varlistentry>
  268. <varlistentry id="view">
  269. <term><command>view</command></term>
  270. <listitem>
  271. <para>Starts <command>vim</command> in read-only mode</para>
  272. <indexterm zone="ch-system-vim view">
  273. <primary sortas="b-view">view</primary>
  274. </indexterm>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry id="vim">
  278. <term><command>vim</command></term>
  279. <listitem>
  280. <para>Is the editor</para>
  281. <indexterm zone="ch-system-vim vim">
  282. <primary sortas="b-vim">vim</primary>
  283. </indexterm>
  284. </listitem>
  285. </varlistentry>
  286. <varlistentry id="vim132">
  287. <term><command>vim132</command></term>
  288. <listitem>
  289. <para>Starts <command>vim</command> with the terminal in 132-column
  290. mode</para>
  291. <indexterm zone="ch-system-vim vim132">
  292. <primary sortas="b-vim132">vim132</primary>
  293. </indexterm>
  294. </listitem>
  295. </varlistentry>
  296. <varlistentry id="vim2html.pl">
  297. <term><command>vim2html.pl</command></term>
  298. <listitem>
  299. <para>Converts Vim documentation to HypterText Markup Language
  300. (HTML)</para>
  301. <indexterm zone="ch-system-vim vim2html.pl">
  302. <primary sortas="b-vim2html.pl">vim2html.pl</primary>
  303. </indexterm>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry id="vimdiff">
  307. <term><command>vimdiff</command></term>
  308. <listitem>
  309. <para>Edits two or three versions of a file with <command>vim</command>
  310. and show differences</para>
  311. <indexterm zone="ch-system-vim vimdiff">
  312. <primary sortas="b-vimdiff">vimdiff</primary>
  313. </indexterm>
  314. </listitem>
  315. </varlistentry>
  316. <varlistentry id="vimm">
  317. <term><command>vimm</command></term>
  318. <listitem>
  319. <para>Enables the DEC locator input model on a remote terminal</para>
  320. <indexterm zone="ch-system-vim vimm">
  321. <primary sortas="b-vimm">vimm</primary>
  322. </indexterm>
  323. </listitem>
  324. </varlistentry>
  325. <varlistentry id="vimspell.sh">
  326. <term><command>vimspell.sh</command></term>
  327. <listitem>
  328. <para>Spell checks a file and generates the syntax statements
  329. necessary to highlight in <command>vim</command>. This script
  330. requires the old Unix <command>spell</command> command, which
  331. is provided neither in LFS nor in BLFS</para>
  332. <indexterm zone="ch-system-vim vimspell.sh">
  333. <primary sortas="b-vimspell.sh">vimspell.sh</primary>
  334. </indexterm>
  335. </listitem>
  336. </varlistentry>
  337. <varlistentry id="vimtutor">
  338. <term><command>vimtutor</command></term>
  339. <listitem>
  340. <para>Teaches the basic keys and commands of
  341. <command>vim</command></para>
  342. <indexterm zone="ch-system-vim vimtutor">
  343. <primary sortas="b-vimtutor">vimtutor</primary>
  344. </indexterm>
  345. </listitem>
  346. </varlistentry>
  347. <varlistentry id="xxd">
  348. <term><command>xxd</command></term>
  349. <listitem>
  350. <para>Creates a hex dump of the given file; it can
  351. also do the reverse, so it can be used for binary patching</para>
  352. <indexterm zone="ch-system-vim xxd">
  353. <primary sortas="b-xxd">xxd</primary>
  354. </indexterm>
  355. </listitem>
  356. </varlistentry>
  357. </variablelist>
  358. </sect2>
  359. </sect1>