source: chapter06/vim.xml@ efca30a

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

Update to glibc-2.28.
Update to gdbm-1.17.
Update to linux-4.17.11.
Update to man-db-2.8.4.

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

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