source: chapter06/vim.xml@ 0bf4dfe

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 7.6 7.7 7.8 7.9 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 0bf4dfe was 0bf4dfe, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Move sed to be after acl.
Remove reference to obsolete /proc/ksyms in modules boot script.
Change internal references to svn to an entitiy.

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

  • Property mode set to 100644
File size: 11.0 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-root;view/&short-version;/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>Prepare Vim for compilation:</para>
52
53<screen><userinput remap="configure">./configure --prefix=/usr --enable-multibyte</userinput></screen>
54
55 <variablelist>
56 <title>The meaning of the configure options:</title>
57
58 <varlistentry>
59 <term><parameter>--enable-multibyte</parameter></term>
60 <listitem>
61 <para>This switch enables support for editing files in multibyte
62 character encodings. This is needed if using a locale with a
63 multibyte character set. This switch is also helpful to be able
64 to edit text files initially created in Linux distributions like
65 Fedora that use UTF-8 as a default character set.</para>
66 </listitem>
67 </varlistentry>
68
69 </variablelist>
70
71 <para>Compile the package:</para>
72
73<screen><userinput remap="make">make</userinput></screen>
74
75 <para>To test the results, issue:</para>
76
77<screen><userinput remap="test">make test</userinput></screen>
78
79 <para>However, this test suite outputs a lot of binary data to the screen,
80 which can cause issues with the settings of the current terminal. This can
81 be resolved by redirecting the output to a log file. A successful test
82 will result in the words "ALL DONE" at completion.</para>
83
84 <para>Install the package:</para>
85
86<screen><userinput remap="install">make HELPSUBLOC=/usr/share/doc/vim-&vim-version; install</userinput></screen>
87
88 <variablelist>
89 <title>The meaning of the make option:</title>
90
91 <varlistentry>
92 <term><parameter>HELPSUBLOC=/usr/share/doc/vim-&vim-version;</parameter></term>
93 <listitem>
94 <para>Tells Vim to install its documentation into
95 <filename class="directory">/usr/share/doc/vim-&vim-version;</filename>
96 instead of
97 <filename class="directory">/usr/share/&vim-docdir;/doc</filename>,
98 for better consistency with the documentation location for other
99 packages.</para>
100 </listitem>
101 </varlistentry>
102
103 </variablelist>
104
105 <para>Many users are used to using <command>vi</command> instead of
106 <command>vim</command>. To allow execution of <command>vim</command>
107 when users habitually enter <command>vi</command>, create a
108 symlink for both the binary and the man page in the provided
109 languages:</para>
110
111<screen><userinput remap="install">ln -sv vim /usr/bin/vi
112for L in /usr/share/man/{,*/}man1/vim.1; do
113 ln -sv vim.1 $(dirname $L)/vi.1
114done</userinput></screen>
115
116 <para>If an X Window System is going to be installed on the LFS
117 system, it may be necessary to recompile Vim after installing X. Vim
118 comes with a GUI version of the editor that requires X and some
119 additional libraries to be installed. For more information on this
120 process, refer to the Vim documentation and the Vim installation page
121 in the BLFS book at <ulink
122 url="&blfs-root;view/&short-version;/postlfs/vim.html"/>.</para>
123
124 </sect2>
125
126 <sect2 id="conf-vim" role="configuration">
127 <title>Configuring Vim</title>
128
129 <indexterm zone="conf-vim">
130 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
131 </indexterm>
132
133 <para>By default, <command>vim</command> runs in vi-incompatible mode.
134 This may be new to users who have used other editors in the past. The
135 <quote>nocompatible</quote> setting is included below to highlight the
136 fact that a new behavior is being used. It also reminds those who would
137 change to <quote>compatible</quote> mode that it should be the first
138 setting in the configuration file. This is necessary because it changes
139 other settings, and overrides must come after this setting. Create a default
140 <command>vim</command> configuration file by running the following:</para>
141
142<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
143<literal>" Begin /etc/vimrc
144
145set nocompatible
146set backspace=2
147syntax on
148if (&amp;term == "iterm") || (&amp;term == "putty")
149 set background=dark
150endif
151
152" End /etc/vimrc</literal>
153EOF</userinput></screen>
154
155 <para>The <parameter>set nocompatible</parameter> setting makes
156 <command>vim</command> behave in a more useful way (the default) than
157 the vi-compatible manner. Remove the <quote>no</quote> to keep the
158 old <command>vi</command> behavior. The <parameter>set
159 backspace=2</parameter> setting allows backspacing over line breaks,
160 autoindents, and the start of insert. The <parameter>syntax
161 on</parameter> parameter enables vim's syntax highlighting. Finally,
162 the <emphasis>if</emphasis> statement with the <parameter>set
163 background=dark</parameter> setting corrects <command>vim</command>'s
164 guess about the background color of some terminal emulators. This
165 gives the highlighting a better color scheme for use on the black
166 background of these programs.</para>
167
168 <para>Documentation for other available options can be obtained by
169 running the following command:</para>
170
171<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
172
173 <note>
174 <para>By default, Vim only installs spell files for the English language.
175 To install spell files for your preferred language, download the
176 <filename>*.spl</filename> and optionally, the <filename>*.sug</filename>
177 files for your language and character encoding from <ulink
178 url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save them to
179 <filename class='directory'>/usr/share/&vim-docdir;/spell/</filename>.</para>
180
181 <para>To use these spell files, some configuration in
182 <filename>/etc/vimrc</filename> is needed, e.g.:</para>
183
184<screen><literal>set spelllang=en,ru
185set spell</literal></screen>
186
187 <para>For more information, see the appropriate README file located
188 at the URL above.</para>
189 </note>
190
191 </sect2>
192
193 <sect2 id="contents-vim" role="content">
194 <title>Contents of Vim</title>
195
196 <segmentedlist>
197 <segtitle>Installed programs</segtitle>
198 <segtitle>Installed directories</segtitle>
199
200 <seglistitem>
201 <seg> ex (link to vim), rview (link to vim), rvim (link to vim), vi
202 (link to vim), view (link to vim), vim, vimdiff (link to vim), vimtutor,
203 and xxd</seg>
204 <seg>/usr/share/doc/vim-&vim-version;, /usr/share/vim</seg>
205 </seglistitem>
206 </segmentedlist>
207
208 <variablelist>
209 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
210 <?dbfo list-presentation="list"?>
211 <?dbhtml list-presentation="table"?>
212
213 <varlistentry id="ex">
214 <term><command>ex</command></term>
215 <listitem>
216 <para>Starts <command>vim</command> in ex mode</para>
217 <indexterm zone="ch-system-vim ex">
218 <primary sortas="b-ex">ex</primary>
219 </indexterm>
220 </listitem>
221 </varlistentry>
222
223 <varlistentry id="rview">
224 <term><command>rview</command></term>
225 <listitem>
226 <para>Is a restricted version of <command>view</command>; no shell
227 commands can be started and <command>view</command> cannot be
228 suspended</para>
229 <indexterm zone="ch-system-vim rview">
230 <primary sortas="b-rview">rview</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="rvim">
236 <term><command>rvim</command></term>
237 <listitem>
238 <para>Is a restricted version of <command>vim</command>; no shell
239 commands can be started and <command>vim</command> cannot be
240 suspended</para>
241 <indexterm zone="ch-system-vim rvim">
242 <primary sortas="b-rvim">rvim</primary>
243 </indexterm>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry id="vi">
248 <term><command>vi</command></term>
249 <listitem>
250 <para>Link to <command>vim</command></para>
251 <indexterm zone="ch-system-vim vi">
252 <primary sortas="b-vi">vi</primary>
253 </indexterm>
254 </listitem>
255 </varlistentry>
256
257 <varlistentry id="view">
258 <term><command>view</command></term>
259 <listitem>
260 <para>Starts <command>vim</command> in read-only mode</para>
261 <indexterm zone="ch-system-vim view">
262 <primary sortas="b-view">view</primary>
263 </indexterm>
264 </listitem>
265 </varlistentry>
266
267 <varlistentry id="vim">
268 <term><command>vim</command></term>
269 <listitem>
270 <para>Is the editor</para>
271 <indexterm zone="ch-system-vim vim">
272 <primary sortas="b-vim">vim</primary>
273 </indexterm>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry id="vimdiff">
278 <term><command>vimdiff</command></term>
279 <listitem>
280 <para>Edits two or three versions of a file with <command>vim</command>
281 and show differences</para>
282 <indexterm zone="ch-system-vim vimdiff">
283 <primary sortas="b-vimdiff">vimdiff</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry id="vimtutor">
289 <term><command>vimtutor</command></term>
290 <listitem>
291 <para>Teaches the basic keys and commands of
292 <command>vim</command></para>
293 <indexterm zone="ch-system-vim vimtutor">
294 <primary sortas="b-vimtutor">vimtutor</primary>
295 </indexterm>
296 </listitem>
297 </varlistentry>
298
299 <varlistentry id="xxd">
300 <term><command>xxd</command></term>
301 <listitem>
302 <para>Creates a hex dump of the given file; it can
303 also do the reverse, so it can be used for binary patching</para>
304 <indexterm zone="ch-system-vim xxd">
305 <primary sortas="b-xxd">xxd</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 </variablelist>
311
312 </sect2>
313
314</sect1>
Note: See TracBrowser for help on using the repository browser.