source: postlfs/editors/vim.xml@ 1f9d38c

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 1f9d38c was cfd4fa8, checked in by Bruce Dubbs <bdubbs@…>, 16 months ago

Tags

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