source: chapter06/vim.xml@ b5b61fd

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 b5b61fd was b5b61fd, checked in by Alexander E. Patrakov <alexander@…>, 20 years ago

Various i18n-related changes to Vim. They need to be duplicated in BLFS also

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

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