source: chapter06/vim.xml@ 98d9003

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 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 98d9003 was 89c1c43d, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Update to gcc-7.1.0.
Update to iproute2-4.11.0.
Fix some faulty gnulib code in diffutils.
Disable a failing test in vim.
Document a failing test in binutils.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11242 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.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
8<sect1 id="ch-system-vim" role="wrap">
9 <?dbhtml filename="vim.html"?>
10
11 <title>Vim-&vim-version;</title>
12
13 <indexterm zone="ch-system-vim">
14 <primary sortas="a-Vim">Vim</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Vim package contains a powerful text editor.</para>
21
22 <segmentedlist>
23 <segtitle>&buildtime;</segtitle>
24 <segtitle>&diskspace;</segtitle>
25
26 <seglistitem>
27 <seg>&vim-ch6-sbu;</seg>
28 <seg>&vim-ch6-du;</seg>
29 </seglistitem>
30 </segmentedlist>
31
32 <tip>
33 <title>Alternatives to Vim</title>
34
35 <para>If you prefer another editor&mdash;such as Emacs, Joe, or
36 Nano&mdash;please refer to <ulink
37 url="&blfs-book;postlfs/editors.html"/> for suggested
38 installation instructions.</para>
39 </tip>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Vim</title>
45
46 <para>First, change the default location of the <filename>vimrc</filename>
47 configuration file to <filename class="directory">/etc</filename>:</para>
48
49<screen><userinput remap="pre">echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
50
51 <para>Disable a test that fails:</para>
52
53<screen><userinput remap="pre">sed -i '/call/{s/split/xsplit/;s/303/492/}' src/testdir/test_recover.vim</userinput></screen>
54
55 <para>Prepare Vim for compilation:</para>
56
57<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
58
59 <para>Compile the package:</para>
60
61<screen><userinput remap="make">make</userinput></screen>
62
63 <para>To test the results, issue:</para>
64
65<screen><userinput remap="test">make -j1 test &amp;&gt; vim-test.log</userinput></screen>
66
67 <para>However, this test suite outputs a lot of binary data to the screen,
68 which can cause issues with the settings of the current terminal. This can
69 be resolved by redirecting the output to a log file. A successful test
70 will result in the words "ALL DONE" at completion.</para>
71
72 <para>Install the package:</para>
73
74<screen><userinput remap="install">make install</userinput></screen>
75
76 <para>Many users are used to using <command>vi</command> instead of
77 <command>vim</command>. To allow execution of <command>vim</command>
78 when users habitually enter <command>vi</command>, create a
79 symlink for both the binary and the man page in the provided
80 languages:</para>
81
82<screen><userinput remap="install">ln -sv vim /usr/bin/vi
83for L in /usr/share/man/{,*/}man1/vim.1; do
84 ln -sv vim.1 $(dirname $L)/vi.1
85done</userinput></screen>
86
87 <para>By default, Vim's documentation is installed in <filename
88 class="directory">/usr/share/vim</filename>. The following symlink
89 allows the documentation to be accessed via <filename
90 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
91 it consistent with the location of documentation for other packages:</para>
92
93<screen><userinput remap="install">ln -sv ../&vim-docdir;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
94
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-book;postlfs/vim.html"/>.</para>
102
103 </sect2>
104
105 <sect2 id="conf-vim" role="configuration">
106 <title>Configuring Vim</title>
107
108 <indexterm zone="conf-vim">
109 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
110 </indexterm>
111
112 <para>By default, <command>vim</command> runs in vi-incompatible mode.
113 This may be new to users who have used other editors in the past. The
114 <quote>nocompatible</quote> setting is included below to highlight the
115 fact that a new behavior is being used. It also reminds those who would
116 change to <quote>compatible</quote> mode that it should be the first
117 setting in the configuration file. This is necessary because it changes
118 other settings, and overrides must come after this setting. Create a default
119 <command>vim</command> configuration file by running the following:</para>
120
121<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
122<literal>" Begin /etc/vimrc
123
124set nocompatible
125set backspace=2
126set mouse=r
127syntax on
128if (&amp;term == "xterm") || (&amp;term == "putty")
129 set background=dark
130endif
131
132
133" End /etc/vimrc</literal>
134EOF
135
136touch ~/.vimrc</userinput></screen>
137
138 <para>The <parameter>set nocompatible</parameter> setting makes
139 <command>vim</command> behave in a more useful way (the default) than the
140 vi-compatible manner. Remove the <quote>no</quote> to keep the old
141 <command>vi</command> behavior. The <parameter>set backspace=2</parameter>
142 setting allows backspacing over line breaks, autoindents, and the start of
143 insert. The <parameter>syntax on</parameter> parameter enables vim's syntax
144 highlighting. The <parameter>set mouse=r</parameter> setting enables
145 proper pasting of text with the mouse when working in chroot or over a
146 remote connection. Finally, the <emphasis>if</emphasis> statement with the
147 <parameter>set background=dark</parameter> setting corrects
148 <command>vim</command>'s guess about the background color of some terminal
149 emulators. This gives the highlighting a better color scheme for use on the
150 black background of these programs.</para>
151
152 <para>Creating an empty <filename>~/.vimrc</filename> prevents vim from
153 overriding settings in <filename>/etc/vimrc</filename> by using
154 <filename>/usr/share/vim/vim80/defaults.vim</filename>.</para>
155
156 <para>Documentation for other available options can be obtained by
157 running the following command:</para>
158
159<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
160
161 <note>
162 <para>By default, Vim only installs spell files for the English language.
163 To install spell files for your preferred language, download the
164 <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
165 files for your language and character encoding from <ulink
166 url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
167 <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
168
169 <para>To use these spell files, some configuration in
170 <filename>/etc/vimrc</filename> is needed, e.g.:</para>
171
172<screen><literal>set spelllang=en,ru
173set spell</literal></screen>
174
175 <para>For more information, see the appropriate README file located
176 at the URL above.</para>
177 </note>
178
179 </sect2>
180
181 <sect2 id="contents-vim" role="content">
182 <title>Contents of Vim</title>
183
184 <segmentedlist>
185 <segtitle>Installed programs</segtitle>
186 <segtitle>Installed directory</segtitle>
187
188 <seglistitem>
189 <seg> ex (link to vim), rview (link to vim), rvim (link to vim), vi
190 (link to vim), view (link to vim), vim, vimdiff (link to vim), vimtutor,
191 and xxd</seg>
192 <seg>/usr/share/vim</seg>
193 </seglistitem>
194 </segmentedlist>
195
196 <variablelist>
197 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
198 <?dbfo list-presentation="list"?>
199 <?dbhtml list-presentation="table"?>
200
201 <varlistentry id="ex">
202 <term><command>ex</command></term>
203 <listitem>
204 <para>Starts <command>vim</command> in ex mode</para>
205 <indexterm zone="ch-system-vim ex">
206 <primary sortas="b-ex">ex</primary>
207 </indexterm>
208 </listitem>
209 </varlistentry>
210
211 <varlistentry id="rview">
212 <term><command>rview</command></term>
213 <listitem>
214 <para>Is a restricted version of <command>view</command>; no shell
215 commands can be started and <command>view</command> cannot be
216 suspended</para>
217 <indexterm zone="ch-system-vim rview">
218 <primary sortas="b-rview">rview</primary>
219 </indexterm>
220 </listitem>
221 </varlistentry>
222
223 <varlistentry id="rvim">
224 <term><command>rvim</command></term>
225 <listitem>
226 <para>Is a restricted version of <command>vim</command>; no shell
227 commands can be started and <command>vim</command> cannot be
228 suspended</para>
229 <indexterm zone="ch-system-vim rvim">
230 <primary sortas="b-rvim">rvim</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="vi">
236 <term><command>vi</command></term>
237 <listitem>
238 <para>Link to <command>vim</command></para>
239 <indexterm zone="ch-system-vim vi">
240 <primary sortas="b-vi">vi</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="view">
246 <term><command>view</command></term>
247 <listitem>
248 <para>Starts <command>vim</command> in read-only mode</para>
249 <indexterm zone="ch-system-vim view">
250 <primary sortas="b-view">view</primary>
251 </indexterm>
252 </listitem>
253 </varlistentry>
254
255 <varlistentry id="vim">
256 <term><command>vim</command></term>
257 <listitem>
258 <para>Is the editor</para>
259 <indexterm zone="ch-system-vim vim">
260 <primary sortas="b-vim">vim</primary>
261 </indexterm>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry id="vimdiff">
266 <term><command>vimdiff</command></term>
267 <listitem>
268 <para>Edits two or three versions of a file with <command>vim</command>
269 and show differences</para>
270 <indexterm zone="ch-system-vim vimdiff">
271 <primary sortas="b-vimdiff">vimdiff</primary>
272 </indexterm>
273 </listitem>
274 </varlistentry>
275
276 <varlistentry id="vimtutor">
277 <term><command>vimtutor</command></term>
278 <listitem>
279 <para>Teaches the basic keys and commands of
280 <command>vim</command></para>
281 <indexterm zone="ch-system-vim vimtutor">
282 <primary sortas="b-vimtutor">vimtutor</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="xxd">
288 <term><command>xxd</command></term>
289 <listitem>
290 <para>Creates a hex dump of the given file; it can
291 also do the reverse, so it can be used for binary patching</para>
292 <indexterm zone="ch-system-vim xxd">
293 <primary sortas="b-xxd">xxd</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297
298 </variablelist>
299
300 </sect2>
301
302</sect1>
Note: See TracBrowser for help on using the repository browser.