source: chapter06/vim.xml@ 24789da

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 24789da was 24789da, checked in by Jeremy Utley <jeremy@…>, 20 years ago

Added a set background=dark option to vim's configuration - makes it look MUCH better on the dark background of a linux console screen

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

  • Property mode set to 100644
File size: 10.7 KB
Line 
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" role="wrap">
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<sect2 role="package"><title/>
13<para>The Vim package contains a powerful text editor.</para>
14
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,
24GCC, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem>
25</segmentedlist>
26
27<tip>
28<title>Alternatives to Vim</title>
29<para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
30have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
31suggested installation instructions.</para>
32</tip>
33</sect2>
34
35<sect2 role="installation">
36<title>Installation of Vim</title>
37
38<para>First change the default locations of the <filename>vimrc</filename> and
39<filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
40
41<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h
42echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput></screen>
43
44<para>Now prepare Vim for compilation:</para>
45
46<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
47
48<para>The optional <userinput>--enable-multibyte</userinput> switch
49includes multibyte editing support into
50vim. It is only needed for those people who ignore our recommendation not to
51use LFS in locales with multibyte character sets, but it does not hurt
52others.</para>
53
54<para>Compile the package:</para>
55
56<screen><userinput>make</userinput></screen>
57
58<para>To test the results, you can issue:
59<userinput>make test</userinput>. However, this test suite outputs a lot of
60seemingly garbage characters to the screen, and this can wreak havoc with the
61settings of the current terminal. Therefore the running of the test suite here
62is strictly optional.</para>
63
64<para>Now install the package:</para>
65
66<screen><userinput>make install</userinput></screen>
67
68<para>Many users are used to using <command>vi</command>, instead of
69<command>vim</command>. To let them execute <command>vim</command> when
70they habitually enter <command>vi</command>, create a symlink:</para>
71
72<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
73
74<para>If you are going to install the X Window system on your LFS system, you
75may want to re-compile Vim after having installed X. Vim comes with a nice GUI
76version of the editor that requires X and a few other libraries to be
77installed. For more information read the Vim documentation.</para>
78
79</sect2>
80
81
82<sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
83<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
84
85<para>By default, <command>vim</command> runs in vi-incompatible mode. Some
86people might not like this, but we prefer to run <command>vim</command> in its
87own mode (else we wouldn't have included it in this book, but the original
88<command>vi</command>). We've included the setting of "nocompatible"
89below to high-light the fact that the new behavior is being used. It
90also reminds those who would change to "compatible" mode that it should
91appear first because it changes other settings and overrides must come
92after this setting. Create a default vim configuration file by running
93the following:</para>
94
95<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
96" Begin /etc/vimrc
97
98set nocompatible
99set backspace=2
100syntax on
101set background=dark
102
103" End /etc/vimrc
104<userinput>EOF</userinput></screen>
105
106<para>The <emphasis>set nocompatible</emphasis> makes
107<command>vim</command> behave in a more useful way (the default) than the
108vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
109behavior. The <emphasis>set backspace=2</emphasis> allows
110backspacing over line breaks, autoindents and the start of insert. The
111<emphasis>syntax on</emphasis> enables <command>vim</command>'s
112syntax highliting, while <emphasis>set background=dark</emphasis> gives the
113highliting a better color scheme for use on the black background of a linux
114console. If you later use X and terminals with a light background, changing
115this will be useful.</para>
116
117<para>Documentation for other available options can be obtained by running
118the following command:</para>
119
120<screen><userinput>vim -c ':options'</userinput></screen>
121
122</sect2>
123
124
125<sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
126
127<segmentedlist>
128<segtitle>Installed programs</segtitle>
129<seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
130pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
131view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
132vimtutor and xxd</seg></seglistitem>
133</segmentedlist>
134
135<variablelist><title>Short descriptions</title>
136
137<varlistentry>
138<term id="efm_filter.pl"><command>efm_filter.pl</command></term>
139<listitem>
140<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
141<para>is a filter for creating an error file that can be read by vim.</para>
142</listitem>
143</varlistentry>
144
145<varlistentry>
146<term id="efm_perl.pl"><command>efm_perl.pl</command></term>
147<listitem>
148<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
149<para>reformats the error messages of the
150Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
151</listitem>
152</varlistentry>
153
154<varlistentry>
155<term id="ex"><command>ex</command></term>
156<listitem>
157<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
158<para>starts vim in ex mode.</para>
159</listitem>
160</varlistentry>
161
162<varlistentry>
163<term id="less.sh"><command>less.sh</command></term>
164<listitem>
165<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
166<para>is a script that starts vim with less.vim.</para>
167</listitem>
168</varlistentry>
169
170<varlistentry>
171<term id="mve.awk"><command>mve.awk</command></term>
172<listitem>
173<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
174<para>processes vim errors.</para>
175</listitem>
176</varlistentry>
177
178<varlistentry>
179<term id="pltags.pl"><command>pltags.pl</command></term>
180<listitem>
181<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
182<para>creates a tags file for perl code, for use by vim.</para>
183</listitem>
184</varlistentry>
185
186<varlistentry>
187<term id="ref"><command>ref</command></term>
188<listitem>
189<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
190<para>checks the spelling of arguments.</para>
191</listitem>
192</varlistentry>
193
194<varlistentry>
195<term id="rview"><command>rview</command></term>
196<listitem>
197<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
198<para>is a restricted version of view: no shell
199commands can be started and view can't be suspended.</para>
200</listitem>
201</varlistentry>
202
203<varlistentry>
204<term id="rvim"><command>rvim</command></term>
205<listitem>
206<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
207<para>is a restricted version of vim: no shell
208commands can be started and vim can't be suspended.</para>
209</listitem>
210</varlistentry>
211
212<varlistentry>
213<term id="shtags.pl"><command>shtags.pl</command></term>
214<listitem>
215<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
216<para>generates a tag file for perl scripts.</para>
217</listitem>
218</varlistentry>
219
220<varlistentry>
221<term id="tcltags"><command>tcltags</command></term>
222<listitem>
223<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
224<para>generates a tag file for TCL code.</para>
225</listitem>
226</varlistentry>
227
228<varlistentry>
229<term id="view"><command>view</command></term>
230<listitem>
231<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
232<para>starts vim in read-only mode.</para>
233</listitem>
234</varlistentry>
235
236<varlistentry>
237<term id="vim"><command>vim</command></term>
238<listitem>
239<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
240<para>is the editor.</para>
241</listitem>
242</varlistentry>
243
244<varlistentry>
245<term id="vim132"><command>vim132</command></term>
246<listitem>
247<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
248<para>starts vim with the terminal in 132-column mode.</para>
249</listitem>
250</varlistentry>
251
252<varlistentry>
253<term id="vim2html.pl"><command>vim2html.pl</command></term>
254<listitem>
255<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
256<para>converts vim documentation to HTML.</para>
257</listitem>
258</varlistentry>
259
260<varlistentry>
261<term id="vimdiff"><command>vimdiff</command></term>
262<listitem>
263<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
264<para>edits two or three versions of a file with vim and show differences.</para>
265</listitem>
266</varlistentry>
267
268<varlistentry>
269<term id="vimm"><command>vimm</command></term>
270<listitem>
271<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
272<para>enables the DEC locator input model on a remote terminal.</para>
273</listitem>
274</varlistentry>
275
276<varlistentry>
277<term id="vimspell.sh"><command>vimspell.sh</command></term>
278<listitem>
279<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
280<para>is a script which spells a file and generates the syntax statements necessary
281to highlight in vim. This script requires the old Unix <command>spell</command>
282command, which is provided neither in LFS nor in BLFS.</para>
283</listitem>
284</varlistentry>
285
286<varlistentry>
287<term id="vimtutor"><command>vimtutor</command></term>
288<listitem>
289<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
290<para>teaches you the basic keys and commands of vim.</para>
291</listitem>
292</varlistentry>
293
294<varlistentry>
295<term id="xxd"><command>xxd</command></term>
296<listitem>
297<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
298<para>makes a hex dump of the given file. It can
299also do the reverse, so it can be used for binary patching.</para>
300</listitem>
301</varlistentry>
302</variablelist>
303
304</sect2>
305
306</sect1>
Note: See TracBrowser for help on using the repository browser.