source: postlfs/editors/vim.xml@ 14e7e0b

12.1 ken/TL2024 lazarus plabs/newcss python3.11 rahul/power-profiles-daemon trunk xry111/llvm18
Last change on this file since 14e7e0b was 875b3b57, checked in by Pierre Labastie <pierre.labastie@…>, 5 months ago

Fix various option vs parameter problems

Sometimes there is no really a problem, but alos avoids that
automatic detection with "make test-options" return false positives

  • Property mode set to 100644
File size: 15.6 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.xz">
10 <!ENTITY vim-download-ftp " ">
11 <!ENTITY vim-md5sum "1af1d018026234d085a82348703461ce">
12 <!ENTITY vim-size "11 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 &lfs120_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"/>,
95 <xref linkend="gtk3"/>, and
96 <xref linkend="rsync"/>
97 </para>
98
99 <bridgehead renderas="sect4">Optional</bridgehead>
100 <para role="optional">
101 <xref linkend="gpm"/>,
102 <xref linkend="lua"/>, and
103 <xref linkend="ruby"/>
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 If you wish to update the runtime files, issue the
208 following command (requires <xref linkend="rsync"/>):
209 </para>
210
211<screen><userinput>rsync -avzcP --exclude="/dos/" --exclude="/spell/" \
212 ftp.nluug.nl::Vim/runtime/ ./runtime/</userinput></screen>
213
214 <para>
215 To install the runtime files and regenerate the
216 <filename>tags</filename> file, as the
217 <systemitem class="username">root</systemitem> user issue:
218 </para>
219
220<screen role="root"><userinput>make -C src installruntime &amp;&amp;
221vim -c ":helptags /usr/share/doc/vim-&vim-version;" -c ":q"</userinput></screen>
222
223 </sect2>
224
225 <sect2 role="commands">
226 <title>Command Explanations</title>
227
228 <para>
229 <parameter>--with-features=huge</parameter>: This switch enables all
230 the additional features available in <application>Vim</application>,
231 including support for multibyte characters.
232 </para>
233
234 <para>
235 <parameter>--with-tlib=ncursesw</parameter>: This switch forces Vim to
236 link against the <filename class="libraryfile">libncursesw</filename>
237 library.
238 </para>
239
240 <para>
241 <option>--enable-gui=no</option>: This will prevent compilation of the
242 GUI. <application>Vim</application> will still link against
243 <application>X</application>, so that some features such as the
244 client-server model or the x11-selection (clipboard) are still available.
245 </para>
246
247 <para>
248 <option>--without-x</option>: If you prefer not to link
249 <application>Vim</application> against <application>X</application>, use
250 this switch.
251 </para>
252
253 <para>
254 <option>--enable-luainterp</option>,
255 <option>--enable-perlinterp</option>,
256 <option>--enable-python3interp=dynamic</option>,
257 <option>--enable-tclinterp --with-tclsh=tclsh</option>,
258 <option>--enable-rubyinterp</option>:
259 These options include the Lua, Perl, Python3, Tcl, or Ruby interpreters
260 that allow using other application code in <application>vim</application>
261 scripts. All the <option>--enable-*</option> options can accept
262 <option>=dynamic</option> to dynamically load the interpreter when
263 needed. This is required for <application>Python 3</application> to
264 prevent segmentation faults. For <application>tcl</application>,
265 it is necessary to indicate the name of the <command>tclsh</command>
266 executable, since <command>configure</command> only searches versioned
267 names with old versions.
268 </para>
269
270 </sect2>
271
272 <sect2 role="configuration">
273 <title>Configuring Vim</title>
274
275 <sect3 id='vim-config'>
276 <title>Config Files</title>
277
278 <para>
279 <filename>/etc/vimrc</filename> and
280 <filename>~/.vimrc</filename>
281 </para>
282
283 <indexterm zone="vim vim-config">
284 <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
285 </indexterm>
286
287 <indexterm zone="vim vim-config">
288 <primary sortas="e-AA.vimrc">~/.vimrc</primary>
289 </indexterm>
290
291 </sect3>
292<!-- there are now desktop files shipped with the package
293 <sect3 id='vim-desktop'>
294 <title>Desktop File</title>
295
296 <para>
297 If desired, create a menu entry for graphical vim,
298 <filename>gvim.desktop</filename>, as the <systemitem
299 class="username">root</systemitem> user
300 </para>
301
302<screen role="root"><userinput>cat &gt; /usr/share/applications/gvim.desktop &lt;&lt; "EOF"
303<literal>[Desktop Entry]
304Name=GVim Text Editor
305Comment=Edit text files
306Comment[pt_BR]=Edite arquivos de texto
307TryExec=gvim
308Exec=gvim -f %F
309Terminal=false
310Type=Application
311Icon=gvim.png
312Categories=Utility;TextEditor;
313StartupNotify=true
314MimeType=text/plain;</literal>
315EOF</userinput></screen>
316
317 </sect3>
318-->
319 <sect3 id='vim-init'>
320 <title>Configuration Information</title>
321
322 <para>
323 <application>Vim</application> has an integrated spell checker
324 which you can enable by issuing the following in a vim window:
325 </para>
326
327<screen><literal>:setlocal spell spelllang=ru</literal></screen>
328
329 <para>
330 This setting will enable spell checking for the Russian
331 language for the current session.
332 </para>
333
334 <para>
335 By default, <application>Vim</application> only installs spell
336 files for the English language. If a spell file is not available for
337 a language, then <application>Vim</application> will call the
338 <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will
339 try to obtain the *.spl and optionally *.sug from the vim ftp server,
340 by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
341 plugin.
342 </para>
343
344<!-- When updating, be sure to change the line below for the proper 'vimxx'
345 unpacked directory -->
346 <para>
347 Alternatively you can manually download the *.spl and *.sug files
348 from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
349 them to <filename class="directory"> ~/.vim/spell </filename> or in
350 <filename
351 class="directory">/usr/share/vim/vim&vim-majmin;/spell/</filename>.
352 </para>
353
354 <para>
355 To find out what's new in <application>Vim-&vim-version;</application>
356 issue the following command:
357 </para>
358
359<screen><literal>:help version-&vim-version;</literal></screen>
360
361 <para>
362 For additional information on setting up
363 <application>Vim</application> configuration files, see <xref
364 linkend="postlfs-config-vimrc"/> and <ulink
365 url="https://vim.fandom.com/wiki/Example_vimrc"/>.
366 </para>
367
368 </sect3>
369
370 </sect2>
371
372 <sect2 role="content">
373 <title>Contents</title>
374
375 <para>
376 A list of the reinstalled files, along with their short
377 descriptions can be found in the
378 <ulink url="&lfs-root;/chapter08/vim.html#contents-vim">LFS Vim
379 Installation Instructions</ulink>.
380 </para>
381
382 <segmentedlist>
383 <segtitle>Installed Programs</segtitle>
384 <segtitle>Installed Libraries</segtitle>
385 <segtitle>Installed Directory</segtitle>
386
387 <seglistitem>
388 <seg>gview, gvim, gvimdiff, gvimtutor, rgview, and rgvim</seg>
389 <seg>None</seg>
390 <seg>/usr/share/vim</seg>
391 </seglistitem>
392 </segmentedlist>
393
394 <variablelist>
395 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
396 <?dbfo list-presentation="list"?>
397 <?dbhtml list-presentation="table"?>
398
399 <varlistentry id="gview">
400 <term><command>gview</command></term>
401 <listitem>
402 <para>
403 starts <command>gvim</command> in read-only mode
404 </para>
405 <indexterm zone="vim gview">
406 <primary sortas="b-gview">gview</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 <varlistentry id="gvim">
412 <term><command>gvim</command></term>
413 <listitem>
414 <para>
415 is the editor that runs under <application>X</application>
416 and includes a GUI
417 </para>
418 <indexterm zone="vim gvim">
419 <primary sortas="b-gvim">gvim</primary>
420 </indexterm>
421 </listitem>
422 </varlistentry>
423
424 <varlistentry id="gvimdiff">
425 <term><command>gvimdiff</command></term>
426 <listitem>
427 <para>
428 edits two or three versions of a file with
429 <command>gvim</command> and shows the differences
430 </para>
431 <indexterm zone="vim gvimdiff">
432 <primary sortas="b-gvimdiff">gvimdiff</primary>
433 </indexterm>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry id="gvimtutor">
438 <term><command>gvimtutor</command></term>
439 <listitem>
440 <para>
441 teaches the basic keys and commands of
442 <command>gvim</command>
443 </para>
444 <indexterm zone="vim gvimtutor">
445 <primary sortas="b-gvimtutor">gvimtutor</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="rgview">
451 <term><command>rgview</command></term>
452 <listitem>
453 <para>
454 is a restricted version of <command>gview</command>
455 </para>
456 <indexterm zone="vim rgview">
457 <primary sortas="b-rgview">rgview</primary>
458 </indexterm>
459 </listitem>
460 </varlistentry>
461
462 <varlistentry id="rgvim">
463 <term><command>rgvim</command></term>
464 <listitem>
465 <para>
466 is a restricted version of <command>gvim</command>
467 </para>
468 <indexterm zone="vim gvim">
469 <primary sortas="b-gvim">gvim</primary>
470 </indexterm>
471 </listitem>
472 </varlistentry>
473
474 </variablelist>
475
476 </sect2>
477
478</sect1>
Note: See TracBrowser for help on using the repository browser.