source: chapter06/vim.xml@ 5dbeba9

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.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 5dbeba9 was 5dbeba9, checked in by Bruce Dubbs <bdubbs@…>, 13 years ago

Update Makefile to better support scripts

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

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