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 " ">
|
---|
8 | <!ENTITY vim-download-ftp "ftp://ftp.vim.org/pub/vim/unix/vim-&vim-version;.tar.bz2">-->
|
---|
9 | <!ENTITY vim-download-http "http://vim.mirror.fr/unix//vim-&vim-version;.tar.bz2">
|
---|
10 | <!ENTITY vim-download-ftp " ">
|
---|
11 | <!ENTITY vim-md5sum "607e135c559be642f210094ad023dc65">
|
---|
12 | <!ENTITY vim-size "9.4 MB">
|
---|
13 | <!ENTITY vim-buildsize "90 MB">
|
---|
14 | <!ENTITY vim-time "1.7 SBU">
|
---|
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 | &lfs77_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"/>,
|
---|
84 | <xref linkend="tcl"/>, and
|
---|
85 | <ulink url="http://sourceforge.net/projects/lesstif/">LessTif</ulink>
|
---|
86 | </para>
|
---|
87 |
|
---|
88 | <para condition="html" role="usernotes">User Notes:
|
---|
89 | <ulink url="&blfs-wiki;/vim"/></para>
|
---|
90 |
|
---|
91 | </sect2>
|
---|
92 |
|
---|
93 | <sect2 role="installation">
|
---|
94 | <title>Installation of Vim</title>
|
---|
95 |
|
---|
96 | <note>
|
---|
97 | <para>If you recompile <application>Vim</application> to link against
|
---|
98 | <application>X</application> and your <application>X</application>
|
---|
99 | libraries are not on the root partition, you will no longer have an
|
---|
100 | editor for use in emergencies. You may choose to install an additional
|
---|
101 | editor, not link <application>Vim</application> against
|
---|
102 | <application>X</application>, or move the current <command>vim</command>
|
---|
103 | executable to the <filename class="directory">/bin</filename> directory
|
---|
104 | under a different name such as <filename>vi</filename>.</para>
|
---|
105 | </note>
|
---|
106 |
|
---|
107 | <para>Install <application>Vim</application> by running the following
|
---|
108 | commands:</para>
|
---|
109 |
|
---|
110 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
|
---|
111 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
|
---|
112 |
|
---|
113 | sed -i 's/luaL_optlong/(long)luaL_optinteger/' src/if_lua.c &&
|
---|
114 |
|
---|
115 | ./configure --prefix=/usr --with-features=huge &&
|
---|
116 | make</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 &&
|
---|
156 | vim -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><option>--enable-gui=no</option>: This will prevent compilation of the
|
---|
171 | GUI. <application>Vim</application> will still link against
|
---|
172 | <application>X</application>, so that some features such as the client-server
|
---|
173 | model or the x11-selection (clipboard) are still available.</para>
|
---|
174 |
|
---|
175 | <para><option>--without-x</option>: If you prefer not to link
|
---|
176 | <application>Vim</application> against <application>X</application>, use
|
---|
177 | this switch.</para>
|
---|
178 |
|
---|
179 | <para><option>--enable-perlinterp</option>, <option>--enable-pythoninterp</option>,
|
---|
180 | <option>--enable-tclinterp</option>, <option>--enable-rubyinterp</option>:
|
---|
181 | These options include the Perl, Python, Tcl, or Ruby interpreters that allow
|
---|
182 | using other application code in <application>vim</application> scripts.</para>
|
---|
183 |
|
---|
184 | </sect2>
|
---|
185 |
|
---|
186 | <sect2 role="configuration">
|
---|
187 | <title>Configuring Vim</title>
|
---|
188 |
|
---|
189 | <sect3 id='vim-config'>
|
---|
190 | <title>Config Files</title>
|
---|
191 |
|
---|
192 | <para><filename>/etc/vimrc</filename> and
|
---|
193 | <filename>~/.vimrc</filename></para>
|
---|
194 |
|
---|
195 | <indexterm zone="vim vim-config">
|
---|
196 | <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
|
---|
197 | </indexterm>
|
---|
198 |
|
---|
199 | <indexterm zone="vim vim-config">
|
---|
200 | <primary sortas="e-AA.vimrc">~/.vimrc</primary>
|
---|
201 | </indexterm>
|
---|
202 |
|
---|
203 | </sect3>
|
---|
204 |
|
---|
205 | <sect3 id='vim-desktop'>
|
---|
206 | <title>Desktop File</title>
|
---|
207 |
|
---|
208 | <para>
|
---|
209 | If desired, create a menu entry for graphical vim,
|
---|
210 | <filename>gvim.desktop</filename>, as the <systemitem
|
---|
211 | class="username">root</systemitem> user
|
---|
212 | </para>
|
---|
213 |
|
---|
214 | <screen role="root"><userinput>cat > /usr/share/applications/gvim.desktop << "EOF"
|
---|
215 | <literal>[Desktop Entry]
|
---|
216 | Name=GVim Text Editor
|
---|
217 | Comment=Edit text files
|
---|
218 | Comment[pt_BR]=Edite arquivos de texto
|
---|
219 | TryExec=gvim
|
---|
220 | Exec=gvim -f %F
|
---|
221 | Terminal=false
|
---|
222 | Type=Application
|
---|
223 | Icon=gvim.png
|
---|
224 | Categories=Utility;TextEditor;
|
---|
225 | StartupNotify=true
|
---|
226 | MimeType=text/plain;</literal>
|
---|
227 | EOF</userinput></screen>
|
---|
228 |
|
---|
229 | </sect3>
|
---|
230 |
|
---|
231 | <sect3 id='vim-init'>
|
---|
232 | <title>Configuration Information</title>
|
---|
233 |
|
---|
234 | <para><application>Vim</application> has an integrated spell checker
|
---|
235 | which you can enable it if you issue the following in a vim window:
|
---|
236 | </para>
|
---|
237 |
|
---|
238 | <screen><literal>:setlocal spell spelllang=ru</literal></screen>
|
---|
239 |
|
---|
240 | <para>This setting will enable spell checking for the Russian
|
---|
241 | language for the current session.</para>
|
---|
242 |
|
---|
243 | <para>By default, <application>Vim</application> only installs spell
|
---|
244 | files for the English language. If a spell file is not available for
|
---|
245 | a language, then <application>Vim</application> will call the
|
---|
246 | <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will try
|
---|
247 | to obtain the *.spl and optionally *.sug from the vim ftp server,
|
---|
248 | by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
|
---|
249 | plugin.</para>
|
---|
250 |
|
---|
251 | <!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
|
---|
252 | directory -->
|
---|
253 | <para>Alternatively you can manually download the *.spl and *.sug files
|
---|
254 | from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
|
---|
255 | them to <filename class="directory"> ~/.vim/spell </filename> or in
|
---|
256 | <filename class="directory">/usr/share/vim/vim74/spell/</filename>.</para>
|
---|
257 |
|
---|
258 | <para>To find out what's new in <application>Vim-&vim-version;</application>
|
---|
259 | issue the following command:</para>
|
---|
260 |
|
---|
261 | <screen><literal>:help version-&vim-version;</literal></screen>
|
---|
262 |
|
---|
263 | <para>For additional information on setting up
|
---|
264 | <application>Vim</application> configuration files, see <xref
|
---|
265 | linkend="postlfs-config-vimrc"/> and <ulink
|
---|
266 | url='http://vim.wikia.com/wiki/Example_vimrc'/>.</para>
|
---|
267 |
|
---|
268 | </sect3>
|
---|
269 |
|
---|
270 | </sect2>
|
---|
271 |
|
---|
272 | <sect2 role="content">
|
---|
273 | <title>Contents</title>
|
---|
274 |
|
---|
275 | <para>A list of the reinstalled files, along with their short
|
---|
276 | descriptions can be found in the <ulink
|
---|
277 | url="&lfs-root;/chapter06/vim.html#contents-vim">LFS Vim Installation
|
---|
278 | Instructions</ulink></para>
|
---|
279 |
|
---|
280 | <segmentedlist>
|
---|
281 | <segtitle>Installed Programs</segtitle>
|
---|
282 | <segtitle>Installed Libraries</segtitle>
|
---|
283 | <segtitle>Installed Directory</segtitle>
|
---|
284 |
|
---|
285 | <seglistitem>
|
---|
286 | <seg>gview, gvim, gvimdiff, rgview, and rgvim</seg>
|
---|
287 | <seg>None</seg>
|
---|
288 | <seg>/usr/share/vim</seg>
|
---|
289 | </seglistitem>
|
---|
290 | </segmentedlist>
|
---|
291 |
|
---|
292 | <variablelist>
|
---|
293 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
294 | <?dbfo list-presentation="list"?>
|
---|
295 | <?dbhtml list-presentation="table"?>
|
---|
296 |
|
---|
297 | <varlistentry id="gview">
|
---|
298 | <term><command>gview</command></term>
|
---|
299 | <listitem>
|
---|
300 | <para>starts <command>gvim</command> in read-only mode.</para>
|
---|
301 | <indexterm zone="vim gview">
|
---|
302 | <primary sortas="b-gview">gview</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | <varlistentry id="gvim">
|
---|
308 | <term><command>gvim</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>is the editor that runs under <application>X</application>
|
---|
311 | and includes a GUI.</para>
|
---|
312 | <indexterm zone="vim gvim">
|
---|
313 | <primary sortas="b-gvim">gvim</primary>
|
---|
314 | </indexterm>
|
---|
315 | </listitem>
|
---|
316 | </varlistentry>
|
---|
317 |
|
---|
318 | <varlistentry id="gvimdiff">
|
---|
319 | <term><command>gvimdiff</command></term>
|
---|
320 | <listitem>
|
---|
321 | <para>edits two or three versions of a file with
|
---|
322 | <command>gvim</command> and shows the differences.</para>
|
---|
323 | <indexterm zone="vim gvimdiff">
|
---|
324 | <primary sortas="b-gvimdiff">gvimdiff</primary>
|
---|
325 | </indexterm>
|
---|
326 | </listitem>
|
---|
327 | </varlistentry>
|
---|
328 |
|
---|
329 | <varlistentry id="rgview">
|
---|
330 | <term><command>rgview</command></term>
|
---|
331 | <listitem>
|
---|
332 | <para>is a restricted version of <command>gview</command>.</para>
|
---|
333 | <indexterm zone="vim rgview">
|
---|
334 | <primary sortas="b-rgview">rgview</primary>
|
---|
335 | </indexterm>
|
---|
336 | </listitem>
|
---|
337 | </varlistentry>
|
---|
338 |
|
---|
339 | <varlistentry id="rgvim">
|
---|
340 | <term><command>rgvim</command></term>
|
---|
341 | <listitem>
|
---|
342 | <para>is a restricted version of <command>gvim</command>. </para>
|
---|
343 | <indexterm zone="vim gvim">
|
---|
344 | <primary sortas="b-gvim">gvim</primary>
|
---|
345 | </indexterm>
|
---|
346 | </listitem>
|
---|
347 | </varlistentry>
|
---|
348 |
|
---|
349 | </variablelist>
|
---|
350 |
|
---|
351 | </sect2>
|
---|
352 |
|
---|
353 | </sect1>
|
---|