source: chapter06/vim.xml@ a48ce94

Last change on this file since a48ce94 was 3f4c310d, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Removed the <beginpage/> tags.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4646 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 11.9 KB
RevLine 
[673b0d8]1<?xml version="1.0" encoding="ISO-8859-1"?>
[1609da8]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
[673b0d8]3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
[752f4e5]6<sect1 id="ch-system-vim" role="wrap">
[673b0d8]7<title>Vim-&vim-version;</title>
8<?dbhtml filename="vim.html"?>
9
10<indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
[6370fa6]11
[a001133]12<sect2 role="package"><title/>
[5888299]13<para>The Vim package contains a powerful text editor.</para>
14
[a001133]15<segmentedlist>
16<segtitle>&buildtime;</segtitle>
17<segtitle>&diskspace;</segtitle>
18<seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem>
19</segmentedlist>
20
21<segmentedlist>
22<segtitle>Vim installation depends on</segtitle>
23<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
[69993f4]24GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem>
[a001133]25</segmentedlist>
[5888299]26
[df8334f]27<tip>
[35c2fa60]28<title>Alternatives to Vim</title>
[69993f4]29<para>If you prefer another editor&mdash;such as Emacs, Joe, or
[3f6be93]30Nano&mdash;please refer to <ulink url="&blfs-root;view/svn/postlfs/editors.html"/>
[69993f4]31for suggested installation instructions.</para>
[df8334f]32</tip>
[35c2fa60]33</sect2>
34
[a001133]35<sect2 role="installation">
[73aedd1d]36<title>Installation of Vim</title>
37
[b5b61fd]38<para>First, unpack both
39<filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
[ef13657]40<filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
[69993f4]41same directory. Then, change the default locations of the
[ef13657]42<filename>vimrc</filename> and <filename>gvimrc</filename>
43configuration files to <filename
44class="directory">/etc</filename>:</para>
[73aedd1d]45
46<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
47echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
48
[39bcf11a]49<para>Vim has a security vulnerability already addressed upstream. The
50following patch fixes the problem:</para>
51
52<screen><userinput>patch -Np1 -i ../vim-&vim-version;-security_fix-1.patch</userinput></screen>
53
54<para>Now prepare Vim for compilation:</para>
[73aedd1d]55
[c3d6ceb]56<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
[73aedd1d]57
[b5b61fd]58<para>The optional but highly recommended
[ef13657]59<parameter>--enable-multibyte</parameter> switch includes support for
60editing files in multibyte character encodings into
[69993f4]61<command>vim</command>. This is needed if using a locale with
[24a08b9]62a multibyte character set. This switch is also helpful to be able to
63edit text files initially created in Linux distributions like Fedora
64Core that use UTF-8 as a default character set.</para>
[dc32fef]65
[73aedd1d]66<para>Compile the package:</para>
67
68<screen><userinput>make</userinput></screen>
69
[69993f4]70<para>To test the results, issue:
[ef13657]71<userinput>make test</userinput>. However, this test suite outputs a
72lot of chaotic characters to the screen, which can cause issues with
73the settings of the current terminal. Therefore, running the test
[69993f4]74suite here is optional.</para>
[1a73ed4]75
[ef13657]76<para>Install the package:</para>
[73aedd1d]77
78<screen><userinput>make install</userinput></screen>
79
[69993f4]80<para>Many users are used to using <command>vi</command> instead of
[ef13657]81<command>vim</command>. To allow execution of <command>vim</command>
[69993f4]82when users habitually enter <command>vi</command>, create a
[ef13657]83symlink:</para>
[73aedd1d]84
85<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
86
[791f27e4]87<para>If the X Window System is going to be installed on the LFS
[69993f4]88system, it may be necessary to recompile Vim after installing X. Vim
[ef13657]89comes with a GUI version of the editor that requires X and some
90additional libraries to be installed. For more information on this
[24a08b9]91process, refer to the Vim documentation and the Vim installation page
92in the BLFS book at <ulink
[3f6be93]93url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
[73aedd1d]94
95</sect2>
[0ba2766b]96
[df8334f]97<sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
[673b0d8]98<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
[342b176]99
[ef13657]100<para>By default, <command>vim</command> runs in vi-incompatible mode.
101This may be new to users who have used other editors in the past. The
102<quote>nocompatible</quote> setting is included below to highlight the
103fact that a new behavior is being used. It also reminds those who
104would change to <quote>compatible</quote> mode that it should appear
105first. This is necessary because it changes other settings, and
[752f4e5]106overrides must come after this setting. Create a default <command>vim</command>
[ef13657]107configuration file by running the following:</para>
[342b176]108
[8ad7980]109<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
[3890f5a]110<literal>" Begin /etc/vimrc
[342b176]111
112set nocompatible
113set backspace=2
114syntax on
[3e05705]115if (&amp;term == "iterm") || (&amp;term == "putty")
116 set background=dark
117endif
[342b176]118
[3890f5a]119" End /etc/vimrc</literal>
[8ad7980]120EOF</userinput></screen>
[342b176]121
[8ad7980]122<para>The <parameter>set nocompatible</parameter> makes
[ef13657]123<command>vim</command> behave in a more useful way (the default) than
[69993f4]124the vi-compatible manner. Remove the <quote>no</quote> to keep the
[ef13657]125old <command>vi</command> behavior. The <parameter>set
126backspace=2</parameter> allows backspacing over line breaks,
127autoindents, and the start of insert. The <parameter>syntax
128on</parameter> enables vim's syntax highlighting. Finally, the
[752f4e5]129<emphasis>if</emphasis> statement with the <parameter>set
[ef13657]130background=dark</parameter> corrects <command>vim</command>'s guess
131about the background color of some terminal emulators. This gives the
132highlighting a better color scheme for use on the black background of
133these programs.</para>
134
135<para>Documentation for other available options can be obtained by
136running the following command:</para>
[dc32fef]137
138<screen><userinput>vim -c ':options'</userinput></screen>
139
[342b176]140</sect2>
[0ba2766b]141
[c6cb3aa]142<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
[673b0d8]143
[c6cb3aa]144<segmentedlist>
145<segtitle>Installed programs</segtitle>
146<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
147pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
148view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
[69993f4]149vimtutor, and xxd</seg></seglistitem>
[c6cb3aa]150</segmentedlist>
[673b0d8]151
[2256873]152<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
[3ed279f]153<?dbfo list-presentation="list"?>
[673b0d8]154
[b8a819f]155<varlistentry id="efm_filter.pl">
156<term><command>efm_filter.pl</command></term>
[c6cb3aa]157<listitem>
[2256873]158<para>A filter for creating an error file that can be read by <command>vim</command></para>
[3ed279f]159<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
[c6cb3aa]160</listitem>
161</varlistentry>
[673b0d8]162
[b8a819f]163<varlistentry id="efm_perl.pl">
164<term><command>efm_perl.pl</command></term>
[c6cb3aa]165<listitem>
[2256873]166<para>Reformats the error messages of the
167Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command></para>
[3ed279f]168<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
[c6cb3aa]169</listitem>
170</varlistentry>
[673b0d8]171
[b8a819f]172<varlistentry id="ex">
173<term><command>ex</command></term>
[c6cb3aa]174<listitem>
[2256873]175<para>Starts <command>vim</command> in ex mode</para>
[3ed279f]176<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
[c6cb3aa]177</listitem>
178</varlistentry>
[673b0d8]179
[b8a819f]180<varlistentry id="less.sh">
181<term><command>less.sh</command></term>
[c6cb3aa]182<listitem>
[2256873]183<para>A script that starts <command>vim</command> with less.vim</para>
[3ed279f]184<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
[c6cb3aa]185</listitem>
186</varlistentry>
[673b0d8]187
[b8a819f]188<varlistentry id="mve.awk">
189<term><command>mve.awk</command></term>
[c6cb3aa]190<listitem>
[2256873]191<para>Processes <command>vim</command> errors</para>
[3ed279f]192<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
[c6cb3aa]193</listitem>
194</varlistentry>
[673b0d8]195
[b8a819f]196<varlistentry id="pltags.pl">
197<term><command>pltags.pl</command></term>
[c6cb3aa]198<listitem>
[2256873]199<para>Creates a tags file for Perl code for use by <command>vim</command></para>
[3ed279f]200<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
[c6cb3aa]201</listitem>
202</varlistentry>
[673b0d8]203
[b8a819f]204<varlistentry id="ref">
205<term><command>ref</command></term>
[c6cb3aa]206<listitem>
[2256873]207<para>Checks the spelling of arguments</para>
[3ed279f]208<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
[c6cb3aa]209</listitem>
210</varlistentry>
[673b0d8]211
[b8a819f]212<varlistentry id="rview">
213<term><command>rview</command></term>
[c6cb3aa]214<listitem>
[2256873]215<para>Is a restricted version of <command>view</command>; no shell
216commands can be started and <command>view</command> cannot be suspended</para>
[3ed279f]217<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
[c6cb3aa]218</listitem>
219</varlistentry>
[673b0d8]220
[b8a819f]221<varlistentry id="rvim">
222<term><command>rvim</command></term>
[c6cb3aa]223<listitem>
[2256873]224<para>Is a restricted version of <command>vim</command>; no shell
225commands can be started and <command>vim</command> cannot be suspended</para>
[3ed279f]226<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
[c6cb3aa]227</listitem>
228</varlistentry>
[73aedd1d]229
[b8a819f]230<varlistentry id="shtags.pl">
231<term><command>shtags.pl</command></term>
[c6cb3aa]232<listitem>
[2256873]233<para>Generates a tag file for Perl scripts</para>
[3ed279f]234<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
[c6cb3aa]235</listitem>
236</varlistentry>
[673b0d8]237
[b8a819f]238<varlistentry id="tcltags">
239<term><command>tcltags</command></term>
[c6cb3aa]240<listitem>
[2256873]241<para>Generates a tag file for TCL code</para>
[3ed279f]242<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
[c6cb3aa]243</listitem>
244</varlistentry>
[673b0d8]245
[b8a819f]246<varlistentry id="view">
247<term><command>view</command></term>
[c6cb3aa]248<listitem>
[2256873]249<para>Starts <command>vim</command> in read-only mode</para>
[3ed279f]250<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
[c6cb3aa]251</listitem>
252</varlistentry>
[673b0d8]253
[2256873]254<varlistentry id="vi">
255<term><command>vi</command></term>
256<listitem>
257<para>Is the editor</para>
258<indexterm zone="ch-system-vim vi"><primary sortas="b-vi">vi</primary></indexterm>
259</listitem>
260</varlistentry>
261
[b8a819f]262<varlistentry id="vim">
263<term><command>vim</command></term>
[c6cb3aa]264<listitem>
[2256873]265<para>Is the editor</para>
[3ed279f]266<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
[c6cb3aa]267</listitem>
268</varlistentry>
[673b0d8]269
[b8a819f]270<varlistentry id="vim132">
271<term><command>vim132</command></term>
[c6cb3aa]272<listitem>
[2256873]273<para>Starts <command>vim</command> with the terminal in 132-column mode</para>
[3ed279f]274<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
[c6cb3aa]275</listitem>
276</varlistentry>
[673b0d8]277
[b8a819f]278<varlistentry id="vim2html.pl">
279<term><command>vim2html.pl</command></term>
[c6cb3aa]280<listitem>
[2256873]281<para>Converts Vim documentation to HypterText Markup Language (HTML)</para>
[3ed279f]282<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
[c6cb3aa]283</listitem>
284</varlistentry>
[673b0d8]285
[b8a819f]286<varlistentry id="vimdiff">
287<term><command>vimdiff</command></term>
[c6cb3aa]288<listitem>
[2256873]289<para>Edits two or three versions of a file with <command>vim</command> and show differences</para>
[3ed279f]290<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
[c6cb3aa]291</listitem>
292</varlistentry>
[673b0d8]293
[b8a819f]294<varlistentry id="vimm">
295<term><command>vimm</command></term>
[c6cb3aa]296<listitem>
[2256873]297<para>Enables the DEC locator input model on a remote terminal</para>
[3ed279f]298<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
[c6cb3aa]299</listitem>
300</varlistentry>
[673b0d8]301
[b8a819f]302<varlistentry id="vimspell.sh">
303<term><command>vimspell.sh</command></term>
[c6cb3aa]304<listitem>
[2256873]305<para>Spells a file and generates the syntax statements necessary
[8ad7980]306to highlight in <command>vim</command>. This script requires the old Unix <command>spell</command>
[2256873]307command, which is provided neither in LFS nor in BLFS</para>
[3ed279f]308<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
[c6cb3aa]309</listitem>
310</varlistentry>
311
[b8a819f]312<varlistentry id="vimtutor">
313<term><command>vimtutor</command></term>
[c6cb3aa]314<listitem>
[2256873]315<para>Teaches the basic keys and commands of <command>vim</command></para>
[3ed279f]316<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
[c6cb3aa]317</listitem>
318</varlistentry>
[673b0d8]319
[b8a819f]320<varlistentry id="xxd">
321<term><command>xxd</command></term>
[c6cb3aa]322<listitem>
[2256873]323<para>Creates a hex dump of the given file; it can
324also do the reverse, so it can be used for binary patching</para>
[3ed279f]325<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
[c6cb3aa]326</listitem>
327</varlistentry>
328</variablelist>
[673b0d8]329
330</sect2>
331
332</sect1>
[ef13657]333
Note: See TracBrowser for help on using the repository browser.