source: postlfs/editors/vim.xml@ d0d2c8f2

elogind
Last change on this file since d0d2c8f2 was d0d2c8f2, checked in by DJ Lucas <dj@…>, 2 years ago

Fix skipped commits.

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