1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <sect1 id="ch-system-vim" xreflabel="Vim">
|
---|
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>
|
---|
11 |
|
---|
12 | <para>The Vim package contains a powerful text editor.</para>
|
---|
13 |
|
---|
14 | <screen>&buildtime; 0.4 SBU
|
---|
15 | &diskspace; 34 MB</screen>
|
---|
16 |
|
---|
17 | <para>Vim installation depends on: Bash, Binutils, Coreutils, Diffutils,
|
---|
18 | GCC, Glibc, Grep, Make, Ncurses, Sed.</para>
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 | <sect2>
|
---|
23 | <title>Alternatives to Vim</title>
|
---|
24 | <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
|
---|
25 | have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
|
---|
26 | suggested installation instructions.</para>
|
---|
27 | </sect2>
|
---|
28 |
|
---|
29 |
|
---|
30 | <sect2>
|
---|
31 | <title>Installation of Vim</title>
|
---|
32 |
|
---|
33 | <para>First change the default locations of the <filename>vimrc</filename> and
|
---|
34 | <filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
|
---|
35 |
|
---|
36 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
|
---|
37 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput></screen>
|
---|
38 |
|
---|
39 | <para>Now prepare Vim for compilation:</para>
|
---|
40 |
|
---|
41 | <screen><userinput>./configure --prefix=/usr</userinput></screen>
|
---|
42 |
|
---|
43 | <para>Compile the package:</para>
|
---|
44 |
|
---|
45 | <screen><userinput>make</userinput></screen>
|
---|
46 |
|
---|
47 | <para>To test the results, you can issue:
|
---|
48 | <userinput>make check</userinput>. However, this test suite outputs a lot of
|
---|
49 | seemingly garbage characters to the screen, and this can wreak havoc with the
|
---|
50 | settings of the current terminal. Therefore the running of the test suite here
|
---|
51 | is strictly optional.</para>
|
---|
52 |
|
---|
53 | <para>Now install the package:</para>
|
---|
54 |
|
---|
55 | <screen><userinput>make install</userinput></screen>
|
---|
56 |
|
---|
57 | <para>Many users are used to using <command>vi</command>, instead of
|
---|
58 | <command>vim</command>. To let them execute <command>vim</command> when
|
---|
59 | they habitually enter <command>vi</command>, create a symlink:</para>
|
---|
60 |
|
---|
61 | <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
|
---|
62 |
|
---|
63 | <para>If you are going to install the X Window system on your LFS system, you
|
---|
64 | may want to re-compile Vim after having installed X. Vim comes with a nice GUI
|
---|
65 | version of the editor that requires X and a few other libraries to be
|
---|
66 | installed. For more information read the Vim documentation.</para>
|
---|
67 |
|
---|
68 | </sect2>
|
---|
69 |
|
---|
70 |
|
---|
71 | <sect2 id="conf-vim"><title>Configuring Vim</title>
|
---|
72 | <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
|
---|
73 |
|
---|
74 | <para>By default, <command>vim</command> runs in vi-incompatible mode. Some
|
---|
75 | people might not like this, but we prefer to run <command>vim</command> in its
|
---|
76 | own mode (else we wouldn't have included it in this book, but the original
|
---|
77 | <command>vi</command>). We've included the setting of "nocompatible"
|
---|
78 | below to high-light the fact that the new behavior is being used. It
|
---|
79 | also reminds those who would change to "compatible" mode that it should
|
---|
80 | appear first because it changes other settings and overrides must come
|
---|
81 | after this setting. Create a default vim configuration file by running
|
---|
82 | the following:</para>
|
---|
83 |
|
---|
84 | <screen><userinput>cat > /etc/vimrc << "EOF"</userinput>
|
---|
85 | " Begin /etc/vimrc
|
---|
86 |
|
---|
87 | set nocompatible
|
---|
88 | set backspace=2
|
---|
89 | syntax on
|
---|
90 |
|
---|
91 | " End /etc/vimrc
|
---|
92 | <userinput>EOF</userinput></screen>
|
---|
93 |
|
---|
94 | <para>The <emphasis>set nocompatible</emphasis> makes
|
---|
95 | <command>vim</command> behave in a more useful way (the default) than the
|
---|
96 | vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
|
---|
97 | behavior. The <emphasis>set backspace=2</emphasis> allows
|
---|
98 | backspacing over line breaks, autoindents and the start of insert. The
|
---|
99 | <emphasis>syntax on</emphasis> enables <command>vim</command>'s
|
---|
100 | semantic coloring.</para>
|
---|
101 |
|
---|
102 | </sect2>
|
---|
103 |
|
---|
104 |
|
---|
105 | <sect2 id="contents-vim"><title>Contents of Vim</title>
|
---|
106 |
|
---|
107 | <para><emphasis>Installed programs</emphasis>: efm_filter.pl, efm_perl.pl, ex
|
---|
108 | (link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim
|
---|
109 | (link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim,
|
---|
110 | vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor
|
---|
111 | and xxd</para>
|
---|
112 |
|
---|
113 | </sect2>
|
---|
114 |
|
---|
115 | <sect2><title>Short descriptions</title>
|
---|
116 |
|
---|
117 | <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
|
---|
118 | <para id="efm_filter.pl"><command>efm_filter.pl</command> is a filter for creating an error
|
---|
119 | file that can be read by vim.</para>
|
---|
120 |
|
---|
121 | <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
|
---|
122 | <para id="efm_perl.pl"><command>efm_perl.pl</command> reformats the error messages of the
|
---|
123 | Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
|
---|
124 |
|
---|
125 | <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
|
---|
126 | <para id="ex"><command>ex</command> starts vim in ex mode.</para>
|
---|
127 |
|
---|
128 | <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
|
---|
129 | <para id="less.sh"><command>less.sh</command> is a script that starts vim with less.vim.</para>
|
---|
130 |
|
---|
131 | <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
|
---|
132 | <para id="mve.awk"><command>mve.awk</command> processes vim errors.</para>
|
---|
133 |
|
---|
134 | <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
|
---|
135 | <para id="pltags.pl"><command>pltags.pl</command> creates a tags file for perl code,
|
---|
136 | for use by vim.</para>
|
---|
137 |
|
---|
138 | <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
|
---|
139 | <para id="ref"><command>ref</command> checks the spelling of arguments.</para>
|
---|
140 |
|
---|
141 | <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
|
---|
142 | <para id="rview"><command>rview</command> is a restricted version of view: no shell
|
---|
143 | commands can be started and view can't be suspended.</para>
|
---|
144 |
|
---|
145 | <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
|
---|
146 | <para id="rvim"><command>rvim</command> is a restricted version of vim: no shell
|
---|
147 | commands can be started and vim can't be suspended.</para>
|
---|
148 |
|
---|
149 | <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
|
---|
150 | <para id="shtags.pl"><command>shtags.pl</command> generates a tag file for perl scripts.</para>
|
---|
151 |
|
---|
152 | <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
|
---|
153 | <para id="tcltags"><command>tcltags</command> generates a tag file for TCL code.</para>
|
---|
154 |
|
---|
155 | <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
|
---|
156 | <para id="view"><command>view</command> starts vim in read-only mode.</para>
|
---|
157 |
|
---|
158 | <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
|
---|
159 | <para id="vim"><command>vim</command> is the editor.</para>
|
---|
160 |
|
---|
161 | <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
|
---|
162 | <para id="vim132"><command>vim132</command> starts vim with the terminal in
|
---|
163 | 132-column mode.</para>
|
---|
164 |
|
---|
165 | <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
|
---|
166 | <para id="vim2html.pl"><command>vim2html.pl</command> converts vim documentation to
|
---|
167 | HTML.</para>
|
---|
168 |
|
---|
169 | <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
|
---|
170 | <para id="vimdiff"><command>vimdiff</command> edits two or three versions of a file with
|
---|
171 | vim and show differences.</para>
|
---|
172 |
|
---|
173 | <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
|
---|
174 | <para id="vimm"><command>vimm</command> enables the DEC locator input model on a
|
---|
175 | remote terminal.</para>
|
---|
176 |
|
---|
177 | <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
|
---|
178 | <para id="vimspell.sh"><command>vimspell.sh</command> is a script which spells a file and generates the syntax
|
---|
179 | statements necessary to highlight in vim.</para>
|
---|
180 |
|
---|
181 | <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
|
---|
182 | <para id="vimtutor"><command>vimtutor</command> teaches you the basic keys and commands
|
---|
183 | of vim.</para>
|
---|
184 |
|
---|
185 | <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
|
---|
186 | <para id="xxd"><command>xxd</command> makes a hex dump of the given file. It can
|
---|
187 | also do the reverse, so it can be used for binary patching.</para>
|
---|
188 |
|
---|
189 | </sect2>
|
---|
190 |
|
---|
191 |
|
---|
192 |
|
---|
193 | </sect1>
|
---|