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

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

Revert "Added command explanation to final-system vim"

This reverts commit dc74128530402b487734b219795760d98cc7c05e.

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