vim.xml 17 KB

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