source: postlfs/editors/vim.xml@ c674ac54

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since c674ac54 was c674ac54, checked in by Krejzi <krejzi@…>, 8 years ago

Update URL for vim.

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

  • Property mode set to 100644
File size: 12.7 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 <!ENTITY vim-download-http "http://ftp.vim.org/vim/unix/vim-&vim-version;.tar.bz2">
8 <!ENTITY vim-download-ftp " ">
9 <!ENTITY vim-md5sum "607e135c559be642f210094ad023dc65">
10 <!ENTITY vim-size "9.4 MB">
11 <!ENTITY vim-buildsize "90 MB">
12 <!ENTITY vim-time "1.7 SBU">
13]>
14
15<sect1 id="vim" xreflabel="Vim-&vim-version;">
16 <?dbhtml filename="vim.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Vim-&vim-version;</title>
24
25 <indexterm zone="vim">
26 <primary sortas="a-Vim">Vim</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Vim</title>
31
32 <para>The <application>Vim</application> package, which is an
33 abbreviation for VI IMproved, contains a <command>vi</command>
34 clone with extra features as compared to the original
35 <command>vi</command>.</para>
36
37 <para>The default LFS instructions install <application>vim</application>
38 as a part of the base system. If you would prefer to link
39 <application>vim</application> against <application>X</application>,
40 you should recompile <application>vim</application> to enable GUI mode.
41 There is no need for special instructions since
42 <application>X</application> support is automatically detected.</para>
43
44 &lfs79_checked;
45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>Download (HTTP): <ulink url="&vim-download-http;"/></para>
50 </listitem>
51 <listitem>
52 <para>Download (FTP): <ulink url="&vim-download-ftp;"/></para>
53 </listitem>
54 <listitem>
55 <para>Download MD5 sum: &vim-md5sum;</para>
56 </listitem>
57 <listitem>
58 <para>Download size: &vim-size;</para>
59 </listitem>
60 <listitem>
61 <para>Estimated disk space required: &vim-buildsize;</para>
62 </listitem>
63 <listitem>
64 <para>Estimated build time: &vim-time;</para>
65 </listitem>
66 </itemizedlist>
67
68 <bridgehead renderas="sect3">Vim Dependencies</bridgehead>
69
70 <bridgehead renderas="sect4">Recommended</bridgehead>
71 <para role="recommended">
72 <xref linkend="x-window-system"/> and
73 <xref linkend="gtk2"/>
74 </para>
75
76 <bridgehead renderas="sect4">Optional</bridgehead>
77 <para role="optional">
78 <xref linkend="gpm"/>,
79 <xref linkend="lua"/>,
80 <xref linkend="python2"/>,
81 <xref linkend="ruby"/>,
82 <xref linkend="tcl"/>, and
83 <ulink url="http://sourceforge.net/projects/lesstif/">LessTif</ulink>
84 </para>
85
86 <para condition="html" role="usernotes">User Notes:
87 <ulink url="&blfs-wiki;/vim"/></para>
88
89 </sect2>
90
91 <sect2 role="installation">
92 <title>Installation of Vim</title>
93
94 <note>
95 <para>If you recompile <application>Vim</application> to link against
96 <application>X</application> and your <application>X</application>
97 libraries are not on the root partition, you will no longer have an
98 editor for use in emergencies. You may choose to install an additional
99 editor, not link <application>Vim</application> against
100 <application>X</application>, or move the current <command>vim</command>
101 executable to the <filename class="directory">/bin</filename> directory
102 under a different name such as <filename>vi</filename>.</para>
103 </note>
104
105 <para>Install <application>Vim</application> by running the following
106 commands:</para>
107
108<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' &gt;&gt; src/feature.h &amp;&amp;
109echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h &amp;&amp;
110
111sed -i 's/luaL_optlong/(long)luaL_optinteger/' src/if_lua.c &amp;&amp;
112
113./configure --prefix=/usr \
114 --with-features=huge \
115 --with-tlib=ncursesw &amp;&amp;
116make</userinput></screen>
117
118 <para>To test the results, issue: <command>make test</command>.
119 The <application>vim</application> test suite outputs a lot of binary
120 data to the screen, which can cause issues with the settings of the
121 current terminal. This can be resolved by redirecting the output to a
122 log file. Even if one of the tests fails to produce the file
123 <filename>test.out</filename> in <filename
124 class="directory">src/testdir</filename>, the remaining tests will still
125 be executed. If all goes well,the final message in the log file will be
126 <literal>ALL DONE</literal>. <emphasis>Note</emphasis>: Some color tests
127 expect to be executed under the <command>xterm</command> terminal
128 emulator.</para>
129
130 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
131
132<screen role="root"><userinput>make install</userinput></screen>
133
134 <para>By default, Vim's documentation is installed in <filename
135 class="directory">/usr/share/vim</filename>. The following symlink allows
136 the documentation to be accessed via <filename
137 class="directory">/usr/share/doc/vim-&vim-version;</filename>, making it
138 consistent with the location of documentation for other packages:</para>
139
140<!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
141 directory -->
142
143<screen role="root"><userinput>ln -snfv ../vim/vim74/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
144
145 <para>If you wish to update the runtime files, issue the
146 following command (requires <xref linkend="rsync"/>):</para>
147
148<screen><userinput>rsync -avzcP --delete --exclude="/dos/" --exclude="/spell/" \
149 ftp.nluug.nl::Vim/runtime/ ./runtime/</userinput></screen>
150
151 <para>To install the runtime files and regenerate the
152 <filename>tags</filename> file, as the
153 <systemitem class="username">root</systemitem> user issue:</para>
154
155<screen role="root"><userinput>make -C src installruntime &amp;&amp;
156vim -c ":helptags /usr/share/doc/vim-&vim-version;" -c ":q"</userinput></screen>
157
158 </sect2>
159
160 <sect2 role="commands">
161 <title>Command Explanations</title>
162
163 <para><command>sed -i ... src/if_lua.c</command>: This sed fixes
164 compilation with <application>lua</application> 5.3.</para>
165
166 <para><parameter>--with-features=huge</parameter>: This switch enables all
167 the additional features available in <application>Vim</application>,
168 including support for multibyte characters.</para>
169
170 <para>
171 <parameter>--with-tlib=ncursesw</parameter>: This switch forces Vim to
172 link against the <filename class="libraryfile">libncursesw</filename>
173 library.
174 </para>
175
176 <para><option>--enable-gui=no</option>: This will prevent compilation of the
177 GUI. <application>Vim</application> will still link against
178 <application>X</application>, so that some features such as the client-server
179 model or the x11-selection (clipboard) are still available.</para>
180
181 <para><option>--without-x</option>: If you prefer not to link
182 <application>Vim</application> against <application>X</application>, use
183 this switch.</para>
184
185 <para><option>--enable-perlinterp</option>, <option>--enable-pythoninterp</option>,
186 <option>--enable-tclinterp</option>, <option>--enable-rubyinterp</option>:
187 These options include the Perl, Python, Tcl, or Ruby interpreters that allow
188 using other application code in <application>vim</application> scripts.</para>
189
190 </sect2>
191
192 <sect2 role="configuration">
193 <title>Configuring Vim</title>
194
195 <sect3 id='vim-config'>
196 <title>Config Files</title>
197
198 <para><filename>/etc/vimrc</filename> and
199 <filename>~/.vimrc</filename></para>
200
201 <indexterm zone="vim vim-config">
202 <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
203 </indexterm>
204
205 <indexterm zone="vim vim-config">
206 <primary sortas="e-AA.vimrc">~/.vimrc</primary>
207 </indexterm>
208
209 </sect3>
210
211 <sect3 id='vim-desktop'>
212 <title>Desktop File</title>
213
214 <para>
215 If desired, create a menu entry for graphical vim,
216 <filename>gvim.desktop</filename>, as the <systemitem
217 class="username">root</systemitem> user
218 </para>
219
220<screen role="root"><userinput>cat &gt; /usr/share/applications/gvim.desktop &lt;&lt; "EOF"
221<literal>[Desktop Entry]
222Name=GVim Text Editor
223Comment=Edit text files
224Comment[pt_BR]=Edite arquivos de texto
225TryExec=gvim
226Exec=gvim -f %F
227Terminal=false
228Type=Application
229Icon=gvim.png
230Categories=Utility;TextEditor;
231StartupNotify=true
232MimeType=text/plain;</literal>
233EOF</userinput></screen>
234
235 </sect3>
236
237 <sect3 id='vim-init'>
238 <title>Configuration Information</title>
239
240 <para><application>Vim</application> has an integrated spell checker
241 which you can enable it if you issue the following in a vim window:
242 </para>
243
244<screen><literal>:setlocal spell spelllang=ru</literal></screen>
245
246 <para>This setting will enable spell checking for the Russian
247 language for the current session.</para>
248
249 <para>By default, <application>Vim</application> only installs spell
250 files for the English language. If a spell file is not available for
251 a language, then <application>Vim</application> will call the
252 <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will try
253 to obtain the *.spl and optionally *.sug from the vim ftp server,
254 by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
255 plugin.</para>
256
257<!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
258 directory -->
259 <para>Alternatively you can manually download the *.spl and *.sug files
260 from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
261 them to <filename class="directory"> ~/.vim/spell </filename> or in
262 <filename class="directory">/usr/share/vim/vim74/spell/</filename>.</para>
263
264 <para>To find out what's new in <application>Vim-&vim-version;</application>
265 issue the following command:</para>
266
267<screen><literal>:help version-&vim-version;</literal></screen>
268
269 <para>For additional information on setting up
270 <application>Vim</application> configuration files, see <xref
271 linkend="postlfs-config-vimrc"/> and <ulink
272 url='http://vim.wikia.com/wiki/Example_vimrc'/>.</para>
273
274 </sect3>
275
276 </sect2>
277
278 <sect2 role="content">
279 <title>Contents</title>
280
281 <para>A list of the reinstalled files, along with their short
282 descriptions can be found in the <ulink
283 url="&lfs-root;/chapter06/vim.html#contents-vim">LFS Vim Installation
284 Instructions</ulink></para>
285
286 <segmentedlist>
287 <segtitle>Installed Programs</segtitle>
288 <segtitle>Installed Libraries</segtitle>
289 <segtitle>Installed Directory</segtitle>
290
291 <seglistitem>
292 <seg>gview, gvim, gvimdiff, rgview, and rgvim</seg>
293 <seg>None</seg>
294 <seg>/usr/share/vim</seg>
295 </seglistitem>
296 </segmentedlist>
297
298 <variablelist>
299 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
300 <?dbfo list-presentation="list"?>
301 <?dbhtml list-presentation="table"?>
302
303 <varlistentry id="gview">
304 <term><command>gview</command></term>
305 <listitem>
306 <para>starts <command>gvim</command> in read-only mode.</para>
307 <indexterm zone="vim gview">
308 <primary sortas="b-gview">gview</primary>
309 </indexterm>
310 </listitem>
311 </varlistentry>
312
313 <varlistentry id="gvim">
314 <term><command>gvim</command></term>
315 <listitem>
316 <para>is the editor that runs under <application>X</application>
317 and includes a GUI.</para>
318 <indexterm zone="vim gvim">
319 <primary sortas="b-gvim">gvim</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
324 <varlistentry id="gvimdiff">
325 <term><command>gvimdiff</command></term>
326 <listitem>
327 <para>edits two or three versions of a file with
328 <command>gvim</command> and shows the differences.</para>
329 <indexterm zone="vim gvimdiff">
330 <primary sortas="b-gvimdiff">gvimdiff</primary>
331 </indexterm>
332 </listitem>
333 </varlistentry>
334
335 <varlistentry id="rgview">
336 <term><command>rgview</command></term>
337 <listitem>
338 <para>is a restricted version of <command>gview</command>.</para>
339 <indexterm zone="vim rgview">
340 <primary sortas="b-rgview">rgview</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="rgvim">
346 <term><command>rgvim</command></term>
347 <listitem>
348 <para>is a restricted version of <command>gvim</command>. </para>
349 <indexterm zone="vim gvim">
350 <primary sortas="b-gvim">gvim</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 </variablelist>
356
357 </sect2>
358
359</sect1>
Note: See TracBrowser for help on using the repository browser.