source: postlfs/editors/vim.xml@ 14891a90

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 14891a90 was 14891a90, checked in by Xi Ruoyao <xry111@…>, 11 months ago

treewide: More "User Notes" clean up

Remove links to pages w/o real contents.

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