source: postlfs/editors/vim.xml

trunk
Last change on this file was 868811b, checked in by Bruce Dubbs <bdubbs@…>, 2 months ago

Many tags.
genutils
sysutils
netlibs
netprogs
netutils
editors
filesystems
shells

  • Property mode set to 100644
File size: 15.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 <!-- only for initial releases of a new version
8 <!ENTITY vim-download-http "http://ftp.vim.org/vim/unix/vim-&vim-version;.tar.bz2">-->
9 <!ENTITY vim-download-http "https://github.com/vim/vim/archive/v&vim-version;/vim-&vim-version;.tar.gz">
10 <!ENTITY vim-download-ftp " ">
11 <!ENTITY vim-md5sum "79dfe62be5d347b1325cbd5ce2a1f9b3">
12 <!ENTITY vim-size "17 MB">
13 <!ENTITY vim-buildsize "125 MB (add 67 MB for tests)">
14 <!ENTITY vim-time "0.3 SBU (with parallelism=4; add 3.0 SBU for tests)">
15]>
16
17<sect1 id="vim" xreflabel="Vim-&vim-version;">
18 <?dbhtml filename="vim.html"?>
19
20
21 <title>Vim-&vim-version;</title>
22
23 <indexterm zone="vim">
24 <primary sortas="a-Vim">Vim</primary>
25 </indexterm>
26
27 <sect2 role="package">
28 <title>Introduction to Vim</title>
29
30 <para>
31 The <application>Vim</application> package, which is an
32 abbreviation for VI IMproved, contains a <command>vi</command>
33 clone with extra features as compared to the original
34 <command>vi</command>.
35 </para>
36
37 <para>
38 The default LFS instructions install <application>vim</application>
39 as a part of the base system. If you would prefer to link
40 <application>vim</application> against <application>X</application>,
41 you should recompile <application>vim</application> to enable GUI mode.
42 There is no need for special instructions since
43 <application>X</application> support is automatically detected.
44 </para>
45
46 <note>
47 <para>
48 The version of vim changes daily. To get the latest
49 version, go to <ulink url="https://github.com/vim/vim/releases">
50 https://github.com/vim/vim/releases</ulink>.
51 </para>
52 </note>
53
54 &lfs121_checked;
55
56 <bridgehead renderas="sect3">Package Information</bridgehead>
57 <itemizedlist spacing="compact">
58 <listitem>
59 <para>
60 Download (HTTP): <ulink url="&vim-download-http;"/>
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Download (FTP): <ulink url="&vim-download-ftp;"/>
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Download MD5 sum: &vim-md5sum;
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 Download size: &vim-size;
76 </para>
77 </listitem>
78 <listitem>
79 <para>
80 Estimated disk space required: &vim-buildsize;
81 </para>
82 </listitem>
83 <listitem>
84 <para>
85 Estimated build time: &vim-time;
86 </para>
87 </listitem>
88 </itemizedlist>
89
90 <bridgehead renderas="sect3">Vim Dependencies</bridgehead>
91
92 <bridgehead renderas="sect4">Recommended</bridgehead>
93 <para role="recommended">
94 <xref linkend="x-window-system"/> and
95 <xref linkend="gtk3"/>
96 </para>
97
98 <bridgehead renderas="sect4">Optional</bridgehead>
99 <para role="optional">
100 <xref linkend="gpm"/>,
101 <xref linkend="lua"/>,
102 <xref linkend="ruby"/>, and
103 <xref linkend="rsync"/>
104 </para>
105
106 </sect2>
107
108 <sect2 role="installation">
109 <title>Installation of Vim</title>
110
111 <note>
112 <para>
113 If you recompile <application>Vim</application> to link against
114 <application>X</application> and your <application>X</application>
115 libraries are not on the root partition, you will no longer have an
116 editor for use in emergencies. You may choose to install an additional
117 editor, not link <application>Vim</application> against
118 <application>X</application>, or move the current <command>vim</command>
119 executable to the <filename class="directory">/bin</filename> directory
120 under a different name such as <filename>vi</filename>.
121 </para>
122 </note>
123<!--
124 <para>
125 First, if you are building the Lua interpreter for VIM, adapt it to an
126 API change in lua-5.4.0:
127 </para>
128
129<screen><userinput remap="pre">sed -i '461 s/static int/int/' src/if_lua.c</userinput></screen>
130-->
131 <para>
132 Install <application>Vim</application> by running the following
133 commands:
134 </para>
135
136 <note>
137 <para>
138 If you intend to run the tests and have not installed Xorg in /usr,
139 append LDFLAGS='-L$XORG_PREFIX/lib' to the configure line below.
140 </para>
141 </note>
142
143<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h &amp;&amp;
144echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h &amp;&amp;
145
146./configure --prefix=/usr \
147 --with-features=huge \
148 --enable-gui=gtk3 \
149 --with-tlib=ncursesw &amp;&amp;
150make</userinput></screen>
151
152 <note>
153 <para>
154 If the global configuration file <filename>/etc/vimrc</filename>
155 references the <envar>VIMRUNTIME</envar> environment variable, some
156 tests may complain about being unable to find the corresponding
157 directory and wait for user input. If this is the case, this file
158 should be saved and removed before running the tests. Or if
159 <xref linkend='bubblewrap'/> is installed, it's also possible to
160 create a lightweight container environment where this file is hidden
161 and run the tests in the container.
162 </para>
163 </note>
164
165 <para>
166 To test the results, issue: <command>make -j1 test</command>, or
167 <command>bwrap --dev-bind / / --dev-bind /dev/null /etc/vimrc make -j1
168 test</command> if running the tests with <xref linkend='bubblewrap'/>
169 and <filename>/etc/vimrc</filename> hidden.
170 Even if one of the tests fails to produce the file
171 <filename>test.out</filename> in <filename
172 class="directory">src/testdir</filename>, the remaining tests will
173 still be executed. If all goes well, the log will report
174 <literal>ALL DONE</literal>. Some tests labelled as
175 <quote>flaky</quote> may fail occasionally and can be ignored.
176 The tests are known to fail if the output is redirected to a file,
177 and also if they are run in a 'screen' session.
178 </para>
179
180 <note>
181 <para>
182 Some color tests expect to be executed under the
183 <command>xterm</command> terminal emulator.
184 </para>
185 </note>
186
187 <para>
188 Now, as the <systemitem class="username">root</systemitem> user:
189 </para>
190
191<screen role="root"><userinput>make install</userinput></screen>
192
193 <para>
194 By default, Vim's documentation is installed in <filename
195 class="directory">/usr/share/vim</filename>. The following symlink allows
196 the documentation to be accessed via <filename
197 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making it
198 consistent with the location of documentation for other packages:
199 </para>
200
201<!-- When updating, be sure to change the vim-majmin entity for the
202 proper 'vimxx' unpacked directory -->
203
204<screen role="root"><userinput>ln -snfv ../vim/vim&vim-majmin;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
205
206 <para>
207 <emphasis role='bold'>If</emphasis> you wish to update the runtime
208 files, issue the following command (requires <xref linkend="rsync"/>)
209 to download it:
210 </para>
211
212<screen role='nodump'><userinput>rsync -avzcP --exclude="/dos/" --exclude="/spell/" \
213 ftp.nluug.nl::Vim/runtime/ ./runtime/</userinput></screen>
214
215 <para>
216 And then install the updated runtime files and regenerate the
217 <filename>tags</filename> file, as the
218 <systemitem class="username">root</systemitem> user issue:
219 </para>
220
221 <!-- already executed by "make install" if not updating the runtime
222 files -->
223<screen role="nodump"><userinput>make -C src installruntime &amp;&amp;
224vim -c ":helptags /usr/share/doc/vim-&vim-version;" -c ":q"</userinput></screen>
225
226 </sect2>
227
228 <sect2 role="commands">
229 <title>Command Explanations</title>
230
231 <para>
232 <parameter>--with-features=huge</parameter>: This switch enables all
233 the additional features available in <application>Vim</application>,
234 including support for multibyte characters.
235 </para>
236
237 <para>
238 <parameter>--with-tlib=ncursesw</parameter>: This switch forces Vim to
239 link against the <filename class="libraryfile">libncursesw</filename>
240 library.
241 </para>
242
243 <para>
244 <option>--enable-gui=no</option>: This will prevent compilation of the
245 GUI. <application>Vim</application> will still link against
246 <application>X</application>, so that some features such as the
247 client-server model or the x11-selection (clipboard) are still available.
248 </para>
249
250 <para>
251 <option>--without-x</option>: If you prefer not to link
252 <application>Vim</application> against <application>X</application>, use
253 this switch.
254 </para>
255
256 <para>
257 <option>--enable-luainterp</option>,
258 <option>--enable-perlinterp</option>,
259 <option>--enable-python3interp=dynamic</option>,
260 <option>--enable-tclinterp --with-tclsh=tclsh</option>,
261 <option>--enable-rubyinterp</option>:
262 These options include the Lua, Perl, Python3, Tcl, or Ruby interpreters
263 that allow using other application code in <application>vim</application>
264 scripts. All the <option>--enable-*</option> options can accept
265 <option>=dynamic</option> to dynamically load the interpreter when
266 needed. This is required for <application>Python 3</application> to
267 prevent segmentation faults. For <application>tcl</application>,
268 it is necessary to indicate the name of the <command>tclsh</command>
269 executable, since <command>configure</command> only searches versioned
270 names with old versions.
271 </para>
272
273 </sect2>
274
275 <sect2 role="configuration">
276 <title>Configuring Vim</title>
277
278 <sect3 id='vim-config'>
279 <title>Config Files</title>
280
281 <para>
282 <filename>/etc/vimrc</filename> and
283 <filename>~/.vimrc</filename>
284 </para>
285
286 <indexterm zone="vim vim-config">
287 <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
288 </indexterm>
289
290 <indexterm zone="vim vim-config">
291 <primary sortas="e-AA.vimrc">~/.vimrc</primary>
292 </indexterm>
293
294 </sect3>
295<!-- there are now desktop files shipped with the package
296 <sect3 id='vim-desktop'>
297 <title>Desktop File</title>
298
299 <para>
300 If desired, create a menu entry for graphical vim,
301 <filename>gvim.desktop</filename>, as the <systemitem
302 class="username">root</systemitem> user
303 </para>
304
305<screen role="root"><userinput>cat &gt; /usr/share/applications/gvim.desktop &lt;&lt; "EOF"
306<literal>[Desktop Entry]
307Name=GVim Text Editor
308Comment=Edit text files
309Comment[pt_BR]=Edite arquivos de texto
310TryExec=gvim
311Exec=gvim -f %F
312Terminal=false
313Type=Application
314Icon=gvim.png
315Categories=Utility;TextEditor;
316StartupNotify=true
317MimeType=text/plain;</literal>
318EOF</userinput></screen>
319
320 </sect3>
321-->
322 <sect3 id='vim-init'>
323 <title>Configuration Information</title>
324
325 <para>
326 <application>Vim</application> has an integrated spell checker
327 which you can enable by issuing the following in a vim window:
328 </para>
329
330<screen><literal>:setlocal spell spelllang=ru</literal></screen>
331
332 <para>
333 This setting will enable spell checking for the Russian
334 language for the current session.
335 </para>
336
337 <para>
338 By default, <application>Vim</application> only installs spell
339 files for the English language. If a spell file is not available for
340 a language, then <application>Vim</application> will call the
341 <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will
342 try to obtain the *.spl and optionally *.sug from the vim ftp server,
343 by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
344 plugin.
345 </para>
346
347<!-- When updating, be sure to change the line below for the proper 'vimxx'
348 unpacked directory -->
349 <para>
350 Alternatively you can manually download the *.spl and *.sug files
351 from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
352 them to <filename class="directory"> ~/.vim/spell </filename> or in
353 <filename
354 class="directory">/usr/share/vim/vim&vim-majmin;/spell/</filename>.
355 </para>
356
357 <para>
358 To find out what's new in <application>Vim-&vim-version;</application>
359 issue the following command:
360 </para>
361
362<screen><literal>:help version-&vim-version;</literal></screen>
363
364 <para>
365 For additional information on setting up
366 <application>Vim</application> configuration files, see <xref
367 linkend="postlfs-config-vimrc"/> and <ulink
368 url="https://vim.fandom.com/wiki/Example_vimrc"/>.
369 </para>
370
371 </sect3>
372
373 </sect2>
374
375 <sect2 role="content">
376 <title>Contents</title>
377
378 <para>
379 A list of the reinstalled files, along with their short
380 descriptions can be found in the
381 <ulink url="&lfs-root;/chapter08/vim.html#contents-vim">LFS Vim
382 Installation Instructions</ulink>.
383 </para>
384
385 <segmentedlist>
386 <segtitle>Installed Programs</segtitle>
387 <segtitle>Installed Libraries</segtitle>
388 <segtitle>Installed Directory</segtitle>
389
390 <seglistitem>
391 <seg>gview, gvim, gvimdiff, gvimtutor, rgview, and rgvim</seg>
392 <seg>None</seg>
393 <seg>/usr/share/vim</seg>
394 </seglistitem>
395 </segmentedlist>
396
397 <variablelist>
398 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
399 <?dbfo list-presentation="list"?>
400 <?dbhtml list-presentation="table"?>
401
402 <varlistentry id="gview">
403 <term><command>gview</command></term>
404 <listitem>
405 <para>
406 starts <command>gvim</command> in read-only mode
407 </para>
408 <indexterm zone="vim gview">
409 <primary sortas="b-gview">gview</primary>
410 </indexterm>
411 </listitem>
412 </varlistentry>
413
414 <varlistentry id="gvim">
415 <term><command>gvim</command></term>
416 <listitem>
417 <para>
418 is the editor that runs under <application>X</application>
419 and includes a GUI
420 </para>
421 <indexterm zone="vim gvim">
422 <primary sortas="b-gvim">gvim</primary>
423 </indexterm>
424 </listitem>
425 </varlistentry>
426
427 <varlistentry id="gvimdiff">
428 <term><command>gvimdiff</command></term>
429 <listitem>
430 <para>
431 edits two or three versions of a file with
432 <command>gvim</command> and shows the differences
433 </para>
434 <indexterm zone="vim gvimdiff">
435 <primary sortas="b-gvimdiff">gvimdiff</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439
440 <varlistentry id="gvimtutor">
441 <term><command>gvimtutor</command></term>
442 <listitem>
443 <para>
444 teaches the basic keys and commands of
445 <command>gvim</command>
446 </para>
447 <indexterm zone="vim gvimtutor">
448 <primary sortas="b-gvimtutor">gvimtutor</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="rgview">
454 <term><command>rgview</command></term>
455 <listitem>
456 <para>
457 is a restricted version of <command>gview</command>
458 </para>
459 <indexterm zone="vim rgview">
460 <primary sortas="b-rgview">rgview</primary>
461 </indexterm>
462 </listitem>
463 </varlistentry>
464
465 <varlistentry id="rgvim">
466 <term><command>rgvim</command></term>
467 <listitem>
468 <para>
469 is a restricted version of <command>gvim</command>
470 </para>
471 <indexterm zone="vim gvim">
472 <primary sortas="b-gvim">gvim</primary>
473 </indexterm>
474 </listitem>
475 </varlistentry>
476
477 </variablelist>
478
479 </sect2>
480
481</sect1>
Note: See TracBrowser for help on using the repository browser.