vim.xml 16 KB

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