source: BOOK/final-system/common/vim.xml@ a3cdc8b

clfs-3.0.0-systemd systemd
Last change on this file since a3cdc8b was da399ef, checked in by Chris Staub <chris@…>, 10 years ago

Slight addition to command explanation for vim

  • Property mode set to 100644
File size: 14.2 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 </sect2>
23
24 <sect2 role="installation">
25 <title>Installation of Vim</title>
26
27 <tip os="t1">
28 <title>Alternatives to Vim</title>
29
30 <para>If you prefer another editor&mdash;such as Emacs, Joe, or
31 Nano&mdash;please refer to <ulink
32 url="&cblfs-root;index.php/Category:Text_Editors"/>
33 for suggested installation instructions.</para>
34 </tip>
35
36 <para os="p1">The following patch merges all updates from the &vim-version; Branch
37 from the Vim developers:</para>
38
39<screen os="p2"><userinput>patch -Np1 -i ../&vim-branch_update-patch;</userinput></screen>
40
41 <para os="b">Change the default location of
42 the <filename>vimrc</filename> configuration file to <filename
43 class="directory">/etc</filename>:</para>
44
45<screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h</userinput></screen>
46
47 <para os="d">Prepare Vim for compilation:</para>
48
49<screen os="e"><userinput>./configure \
50 --prefix=/usr --enable-multibyte</userinput></screen>
51
52 <para os="g">Compile the package:</para>
53
54<screen os="h"><userinput>make</userinput></screen>
55
56 <para os="i">To test the results, issue:</para>
57
58<screen os="i2"><userinput remap="test">make test</userinput></screen>
59
60 <para os="i3">However, this test suite outputs a lot of binary data to the
61 screen, which can cause issues with the settings of the current terminal.
62 This can be resolved by redirecting the output to a log file.</para>
63
64 <para os="j">Install the package:</para>
65
66<screen os="k"><userinput>make HELPSUBLOC=/usr/share/doc/vim-&vim-version; install</userinput></screen>
67
68 <variablelist os="l">
69 <title>The meaning of the make option:</title>
70
71 <varlistentry>
72 <term><parameter>HELPSUBLOC=/usr/share/doc/vim-&vim-version;</parameter></term>
73 <listitem>
74 <para>Tells Vim to install its documentation into
75 <filename class="directory">/usr/share/doc/vim-&vim-version;</filename>
76 instead of
77 <filename class="directory">/usr/share/vim/vim&vim-version2;/doc</filename>,
78 for better consistency with the documentation location for other
79 packages.</para>
80 </listitem>
81 </varlistentry>
82
83 </variablelist>
84
85 <para os="m">Many users are accustomed to using <command>vi</command>
86 instead of <command>vim</command>. Some programs, such as
87 <command>vigr</command> and <command>vipw</command>, also use
88 <command>vi</command>. Create a symlink to permit execution of
89 <command>vim</command> when users habitually enter <command>vi</command>
90 and allow programs that use <command>vi</command> to work:</para>
91
92<screen os="n"><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
93
94 <para os="o">If an X Window System is going to be installed on the CLFS
95 system, you may want to recompile Vim after installing X. Vim
96 comes with a GUI version of the editor that requires X and some
97 additional libraries to be installed. For more information, refer to the
98 Vim documentation and the Vim installation page in CBLFS at <ulink
99 url="&cblfs-root;index.php/Vim"/>.</para>
100
101 </sect2>
102
103 <sect2 id="conf-vim" role="configuration">
104 <title>Configuring Vim</title>
105
106 <indexterm zone="conf-vim">
107 <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
108 </indexterm>
109
110 <para>By default, <command>vim</command> runs in vi-incompatible mode.
111 This may be new to users who have used other editors in the past. The
112 <quote>nocompatible</quote> setting is included below to highlight the
113 fact that a new behavior is being used. It also reminds those who would
114 change to <quote>compatible</quote> mode that it should be the first
115 setting in the configuration file. This is necessary because it changes
116 other settings, and overrides must come after this setting. Create a
117 default <command>vim</command> configuration file by running the
118 following:</para>
119
120<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
121<literal>" Begin /etc/vimrc
122
123set nocompatible
124set backspace=2
125set ruler
126syntax on
127if (&amp;term == "iterm") || (&amp;term == "putty")
128 set background=dark
129endif
130
131" End /etc/vimrc</literal>
132EOF</userinput></screen>
133
134
135 <para>The <parameter>set nocompatible</parameter> makes
136 <command>vim</command> behave in a more useful way (the default) than
137 the vi-compatible manner. Remove the <quote>no</quote> to keep the
138 old <command>vi</command> behavior. The <parameter>set
139 backspace=2</parameter> allows backspacing over line breaks,
140 autoindents, and the start of insert. The <parameter>syntax
141 on</parameter> enables vim's syntax highlighting. Finally, the
142 <emphasis>if</emphasis> statement with the <parameter>set
143 background=dark</parameter> corrects <command>vim</command>'s guess
144 about the background color of some terminal emulators. This gives the
145 highlighting a better color scheme for use on the black background of
146 these programs.</para>
147
148 <para>Documentation for other available options can be obtained by
149 running the following command:</para>
150
151<screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
152
153 </sect2>
154
155 <sect2 id="contents-vim" role="content">
156 <title>Contents of Vim</title>
157
158 <segmentedlist>
159 <segtitle>Installed programs</segtitle>
160 <segtitle>Installed directories</segtitle>
161
162 <seglistitem>
163 <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
164 pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
165 tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
166 vimdiff (link to vim), vimm, vimspell.sh, vimtutor, xxd</seg>
167 <seg>/usr/share/vim, /usr/share/doc/vim-&vim-version;</seg>
168 </seglistitem>
169 </segmentedlist>
170
171 <variablelist>
172 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
173 <?dbfo list-presentation="list"?>
174 <?dbhtml list-presentation="table"?>
175
176 <varlistentry id="efm_filter.pl">
177 <term><command>efm_filter.pl</command></term>
178 <listitem>
179 <para>A filter for creating an error file that can be read
180 by <command>vim</command></para>
181 <indexterm zone="ch-system-vim efm_filter.pl">
182 <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
183 </indexterm>
184 </listitem>
185 </varlistentry>
186
187 <varlistentry id="efm_perl.pl">
188 <term><command>efm_perl.pl</command></term>
189 <listitem>
190 <para>Reformats the error messages of the Perl interpreter for use
191 with the <quote>quickfix</quote> mode of <command>vim</command></para>
192 <indexterm zone="ch-system-vim efm_perl.pl">
193 <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
194 </indexterm>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry id="ex">
199 <term><command>ex</command></term>
200 <listitem>
201 <para>Starts <command>vim</command> in ex mode</para>
202 <indexterm zone="ch-system-vim ex">
203 <primary sortas="b-ex">ex</primary>
204 </indexterm>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry id="less.sh">
209 <term><command>less.sh</command></term>
210 <listitem>
211 <para>A script that starts <command>vim</command> with less.vim</para>
212 <indexterm zone="ch-system-vim less.sh">
213 <primary sortas="b-less.sh">less.sh</primary>
214 </indexterm>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry id="mve.awk">
219 <term><command>mve.awk</command></term>
220 <listitem>
221 <para>Processes <command>vim</command> errors</para>
222 <indexterm zone="ch-system-vim mve.awk">
223 <primary sortas="b-mve.awk">mve.awk</primary>
224 </indexterm>
225 </listitem>
226 </varlistentry>
227
228 <varlistentry id="pltags.pl">
229 <term><command>pltags.pl</command></term>
230 <listitem>
231 <para>Creates a tags file for Perl code for use by
232 <command>vim</command></para>
233 <indexterm zone="ch-system-vim pltags.pl">
234 <primary sortas="b-pltags.pl">pltags.pl</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry id="ref">
240 <term><command>ref</command></term>
241 <listitem>
242 <para>Checks the spelling of arguments</para>
243 <indexterm zone="ch-system-vim ref">
244 <primary sortas="b-ref">ref</primary>
245 </indexterm>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry id="rview">
250 <term><command>rview</command></term>
251 <listitem>
252 <para>Is a restricted version of <command>view</command>; no shell
253 commands can be started and <command>view</command> cannot be
254 suspended</para>
255 <indexterm zone="ch-system-vim rview">
256 <primary sortas="b-rview">rview</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="rvim">
262 <term><command>rvim</command></term>
263 <listitem>
264 <para>Is a restricted version of <command>vim</command>; no shell
265 commands can be started and <command>vim</command> cannot be
266 suspended</para>
267 <indexterm zone="ch-system-vim rvim">
268 <primary sortas="b-rvim">rvim</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry id="shtags.pl">
274 <term><command>shtags.pl</command></term>
275 <listitem>
276 <para>Generates a tags file for Perl scripts</para>
277 <indexterm zone="ch-system-vim shtags.pl">
278 <primary sortas="b-shtags.pl">shtags.pl</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry id="tcltags">
284 <term><command>tcltags</command></term>
285 <listitem>
286 <para>Generates a tags file for TCL code</para>
287 <indexterm zone="ch-system-vim tcltags">
288 <primary sortas="b-tcltags">tcltags</primary>
289 </indexterm>
290 </listitem>
291 </varlistentry>
292
293 <varlistentry id="view">
294 <term><command>view</command></term>
295 <listitem>
296 <para>Starts <command>vim</command> in read-only mode</para>
297 <indexterm zone="ch-system-vim view">
298 <primary sortas="b-view">view</primary>
299 </indexterm>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry id="vi">
304 <term><command>vi</command></term>
305 <listitem>
306 <para>Link to <command>vim</command></para>
307 <indexterm zone="ch-system-vim vi">
308 <primary sortas="b-vi">vi</primary>
309 </indexterm>
310 </listitem>
311 </varlistentry>
312
313 <varlistentry id="vim">
314 <term><command>vim</command></term>
315 <listitem>
316 <para>Is the editor</para>
317 <indexterm zone="ch-system-vim vim">
318 <primary sortas="b-vim">vim</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="vim132">
324 <term><command>vim132</command></term>
325 <listitem>
326 <para>Starts <command>vim</command> with the terminal in 132-column
327 mode</para>
328 <indexterm zone="ch-system-vim vim132">
329 <primary sortas="b-vim132">vim132</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="vim2html.pl">
335 <term><command>vim2html.pl</command></term>
336 <listitem>
337 <para>Converts Vim documentation to HypterText Markup Language
338 (HTML)</para>
339 <indexterm zone="ch-system-vim vim2html.pl">
340 <primary sortas="b-vim2html.pl">vim2html.pl</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="vimdiff">
346 <term><command>vimdiff</command></term>
347 <listitem>
348 <para>Edits two or three versions of a file with <command>vim</command>
349 and show differences</para>
350 <indexterm zone="ch-system-vim vimdiff">
351 <primary sortas="b-vimdiff">vimdiff</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
356 <varlistentry id="vimm">
357 <term><command>vimm</command></term>
358 <listitem>
359 <para>Enables the DEC locator input model on a remote terminal</para>
360 <indexterm zone="ch-system-vim vimm">
361 <primary sortas="b-vimm">vimm</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="vimspell.sh">
367 <term><command>vimspell.sh</command></term>
368 <listitem>
369 <para>Spell checks a file and generates the syntax statements
370 necessary to highlight in <command>vim</command>. This script
371 requires the old Unix <command>spell</command> command, which
372 is provided neither in CLFS nor in CBLFS</para>
373 <indexterm zone="ch-system-vim vimspell.sh">
374 <primary sortas="b-vimspell.sh">vimspell.sh</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry id="vimtutor">
380 <term><command>vimtutor</command></term>
381 <listitem>
382 <para>Teaches the basic keys and commands of
383 <command>vim</command></para>
384 <indexterm zone="ch-system-vim vimtutor">
385 <primary sortas="b-vimtutor">vimtutor</primary>
386 </indexterm>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry id="xxd">
391 <term><command>xxd</command></term>
392 <listitem>
393 <para>Creates a hex dump of the given file; it can
394 also do the reverse, so it can be used for binary patching</para>
395 <indexterm zone="ch-system-vim xxd">
396 <primary sortas="b-xxd">xxd</primary>
397 </indexterm>
398 </listitem>
399 </varlistentry>
400
401 </variablelist>
402
403 </sect2>
404
405</sect1>
Note: See TracBrowser for help on using the repository browser.