source: postlfs/editors/vim.xml@ 4c72ea0b

11.0 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 4c72ea0b was 4c72ea0b, checked in by Pierre Labastie <pieere@…>, 8 months ago

Remove python2 ad in vim

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24341 af4574ff-66df-0310-9fd7-8a98e5e911e0

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