source: postlfs/editors/vim.xml@ 920e139

12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since 920e139 was 44b3f440, checked in by Xi Ruoyao <xry111@…>, 10 months ago

treewide: Really remove commented out references to Python 2

It helps using grep for finding packages depending on Python 2.

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