source: postlfs/editors/vim.xml@ 14430302

10.0 10.1 11.0 9.1 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 14430302 was 14430302, checked in by Bruce Dubbs <bdubbs@…>, 20 months ago

Make the version of vim in th ebook always available

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

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