[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 |
|
---|
[fcb77dd] | 7 | <!ENTITY vim-download-http "http://www2.nl.vim.org/unix/vim-&vim-version;.tar.bz2">
|
---|
[b5951ec] | 8 | <!ENTITY vim-download-ftp "ftp://ftp.vim.org/pub/vim/unix/vim-&vim-version;.tar.bz2">
|
---|
[fcb77dd] | 9 | <!ENTITY vim-md5sum "f0901284b338e448bfd79ccca0041254">
|
---|
| 10 | <!ENTITY vim-size "7.2 MB">
|
---|
[40fe030] | 11 | <!ENTITY vim-buildsize "75 MB">
|
---|
[e26dfbf7] | 12 | <!ENTITY vim-time "0.8 SBU">
|
---|
[b5951ec] | 13 | ]>
|
---|
| 14 |
|
---|
[28badf4] | 15 | <sect1 id="vim" xreflabel="Vim-&vim-version;">
|
---|
[0ec75653] | 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>
|
---|
[3aa07d1] | 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
|
---|
[0ec75653] | 42 | <application>X</application> support is automatically detected.</para>
|
---|
| 43 |
|
---|
| 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (HTTP): <ulink url="&vim-download-http;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (FTP): <ulink url="&vim-download-ftp;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download MD5 sum: &vim-md5sum;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download size: &vim-size;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated disk space required: &vim-buildsize;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated build time: &vim-time;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </itemizedlist>
|
---|
| 65 |
|
---|
| 66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 67 | <itemizedlist spacing='compact'>
|
---|
[e26dfbf7] | 68 | <listitem>
|
---|
[0f39a2b] | 69 | <para>Required Patch: <ulink
|
---|
[7f4cdbc0] | 70 | url="&patch-root;/vim-&vim-version;-fixes-5.patch"/></para>
|
---|
[0f39a2b] | 71 | </listitem>
|
---|
[0ec75653] | 72 | <listitem>
|
---|
[3aa07d1] | 73 | <para>Translated Vim messages: <ulink
|
---|
[fcb77dd] | 74 | url="http://www2.nl.vim.org/extra/vim-&vim-version;-lang.tar.gz"/>
|
---|
[0ec75653] | 75 | </para>
|
---|
| 76 | </listitem>
|
---|
| 77 | </itemizedlist>
|
---|
| 78 |
|
---|
[3493b1f] | 79 | <bridgehead renderas="sect3">Vim Dependencies</bridgehead>
|
---|
[0ec75653] | 80 |
|
---|
| 81 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[e77976f] | 82 | <para role="recommended"><xref linkend="x-window-system"/></para>
|
---|
[0ec75653] | 83 |
|
---|
| 84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[6ae4193] | 85 | <para role="optional"><xref linkend="gtk2"/> or
|
---|
| 86 | <xref linkend="lesstif"/> or
|
---|
[bbaa1db] | 87 | <xref linkend="GTK"/>,
|
---|
[3aa07d1] | 88 | <xref linkend="python"/>,
|
---|
| 89 | <xref linkend="tcl"/>,
|
---|
[6ae4193] | 90 | <xref linkend="ruby"/>, and
|
---|
| 91 | <xref linkend="gpm"/></para>
|
---|
| 92 | <!-- mentioned below as a runtime dependency
|
---|
[410e228b] | 93 | <xref linkend="rsync"/> (to update the runtime files)
|
---|
[6ae4193] | 94 | -->
|
---|
[0ec75653] | 95 |
|
---|
[3597eb6] | 96 | <para condition="html" role="usernotes">User Notes:
|
---|
| 97 | <ulink url="&blfs-wiki;/vim"/></para>
|
---|
| 98 |
|
---|
[0ec75653] | 99 | </sect2>
|
---|
| 100 |
|
---|
| 101 | <sect2 role="installation">
|
---|
| 102 | <title>Installation of Vim</title>
|
---|
| 103 |
|
---|
| 104 | <note>
|
---|
[3aa07d1] | 105 | <para>If you recompile <application>Vim</application> to link against
|
---|
[32d0e29] | 106 | <application>X</application> and your <application>X</application>
|
---|
[823b1a3] | 107 | libraries are not on the root partition, you will no longer have an editor
|
---|
[3aa07d1] | 108 | for use in emergencies. You may choose to install an additional editor,
|
---|
| 109 | not link <application>Vim</application> against
|
---|
[d612b9f] | 110 | <application>X</application>, or move the current <command>vim</command>
|
---|
[3aa07d1] | 111 | executable to the <filename class="directory">/bin</filename> directory
|
---|
[0ec75653] | 112 | under a different name such as <filename>vi</filename>.</para>
|
---|
| 113 | </note>
|
---|
| 114 |
|
---|
| 115 | <para>If desired, unpack the translated messages archive:</para>
|
---|
| 116 |
|
---|
[8ba8ab5] | 117 | <screen><userinput>tar -xf ../vim-&vim-version;-lang.tar.gz --strip-components=1</userinput></screen>
|
---|
[d612b9f] | 118 |
|
---|
[0ec75653] | 119 | <para>Install <application>Vim</application> by running the following
|
---|
| 120 | commands:</para>
|
---|
[b5951ec] | 121 |
|
---|
[7f4cdbc0] | 122 | <screen><userinput>patch -Np1 -i ../vim-&vim-version;-fixes-5.patch &&
|
---|
[e26dfbf7] | 123 | echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
|
---|
[b5951ec] | 124 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
|
---|
[8e8356d] | 125 | ./configure --prefix=/usr --with-features=huge &&
|
---|
[0ec75653] | 126 | make</userinput></screen>
|
---|
| 127 |
|
---|
[83d6546] | 128 | <para>To test the results, issue: <command>make test</command>.
|
---|
| 129 | The <application>vim</application> test suite outputs a lot of binary
|
---|
| 130 | data to the screen, which can cause issues with the settings of the
|
---|
| 131 | current terminal. This can be resolved by redirecting the output to a
|
---|
| 132 | log file. Even if one of the tests fails to produce the file
|
---|
| 133 | <filename>test.out</filename> in <filename
|
---|
| 134 | class="directory">src/testdir</filename>, the remaining tests will still
|
---|
| 135 | be executed. If all goes well,the final message in the log file will be
|
---|
| 136 | <literal>ALL DONE</literal>. <emphasis>Note</emphasis>: Some color tests
|
---|
| 137 | expect to be executed under the <command>xterm</command> terminal
|
---|
| 138 | emulator.</para>
|
---|
| 139 |
|
---|
[0ec75653] | 140 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 141 |
|
---|
| 142 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 143 |
|
---|
[95799899] | 144 | <para>By default, Vim's documentation is installed in <filename
|
---|
| 145 | class="directory">/usr/share/vim</filename>. The following symlink allows
|
---|
| 146 | the documentation to be accessed via <filename
|
---|
[6e11352] | 147 | class="directory">/usr/share/doc/vim-&vim-version;</filename>, making it
|
---|
| 148 | consistent with the location of documentation for other packages:</para>
|
---|
[841a93f] | 149 |
|
---|
[410e228b] | 150 | <!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
|
---|
[841a93f] | 151 | directory -->
|
---|
| 152 |
|
---|
[fcb77dd] | 153 | <screen role="root"><userinput>ln -snfv ../vim/vim72/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
|
---|
[95799899] | 154 |
|
---|
[6ae4193] | 155 | <para>If you wish to update the runtime files, issue the
|
---|
| 156 | following command (requires <xref linkend="rsync"/>):</para>
|
---|
[fd7e0ed6] | 157 |
|
---|
[32d0e29] | 158 | <screen><userinput>rsync -avzcP --delete --exclude="/dos/" --exclude="/spell/" \
|
---|
| 159 | ftp.nluug.nl::Vim/runtime/ ./runtime/</userinput></screen>
|
---|
[6e11352] | 160 |
|
---|
[32d0e29] | 161 | <para>To install the runtime files and regenerate the
|
---|
| 162 | <filename>tags</filename> file, as the
|
---|
| 163 | <systemitem class="username">root</systemitem> user issue:</para>
|
---|
[6e11352] | 164 |
|
---|
[2202183] | 165 | <screen role="root"><userinput>make -C src installruntime &&
|
---|
| 166 | vim -c ":helptags /usr/share/doc/vim-&vim-version;" -c ":q"</userinput></screen>
|
---|
[6e11352] | 167 |
|
---|
[0ec75653] | 168 | </sect2>
|
---|
| 169 |
|
---|
| 170 | <sect2 role="commands">
|
---|
| 171 | <title>Command Explanations</title>
|
---|
| 172 |
|
---|
[32d0e29] | 173 | <para><command>patch …</command>: These patches are the same as the
|
---|
[8ae8a12a] | 174 | ones in the LFS build used to update the package with upstream patches
|
---|
[32d0e29] | 175 | and ensure the man pages are placed in the proper locations.</para>
|
---|
[e26dfbf7] | 176 |
|
---|
[3aa07d1] | 177 | <para><parameter>--with-features=huge</parameter>: This switch enables all
|
---|
[0ec75653] | 178 | the additional features available in <application>Vim</application>.</para>
|
---|
| 179 |
|
---|
[88a2276] | 180 | <para><option>--enable-gui=no</option>: This will prevent compilation of the
|
---|
| 181 | GUI. <application>Vim</application> will still link against
|
---|
[6e11352] | 182 | <application>X</application>, so that some features such as the client-server
|
---|
| 183 | model or the x11-selection (clipboard) are still available.</para>
|
---|
[9f12e36] | 184 |
|
---|
[4967eaf6] | 185 | <para><option>--without-x</option>: If you prefer not to link
|
---|
| 186 | <application>Vim</application> against <application>X</application>, use
|
---|
| 187 | this switch.</para>
|
---|
[0ec75653] | 188 |
|
---|
[95799899] | 189 | <para><option>--enable-perlinterp</option>, <option>--enable-pythoninterp</option>,
|
---|
[864b24de] | 190 | <option>--enable-tclinterp</option>, <option>--enable-rubyinterp</option>:
|
---|
[f8c734f] | 191 | These options include the Perl, Python, Tcl, or Ruby interpreters that allow
|
---|
[864b24de] | 192 | using other application code in <application>vim</application> scripts.</para>
|
---|
| 193 |
|
---|
[95799899] | 194 | </sect2>
|
---|
| 195 |
|
---|
| 196 | <sect2 role="configuration">
|
---|
| 197 | <title>Configuring Vim</title>
|
---|
| 198 |
|
---|
| 199 | <sect3 id='vim-config'>
|
---|
| 200 | <title>Config Files</title>
|
---|
| 201 |
|
---|
| 202 | <para><filename>/etc/vimrc</filename> and
|
---|
| 203 | <filename>~/.vimrc</filename></para>
|
---|
| 204 |
|
---|
| 205 | <indexterm zone="vim vim-config">
|
---|
| 206 | <primary sortas="e-etc-vimrc">/etc/vimrc</primary>
|
---|
| 207 | </indexterm>
|
---|
| 208 |
|
---|
| 209 | <indexterm zone="vim vim-config">
|
---|
| 210 | <primary sortas="e-AA.vimrc">~/.vimrc</primary>
|
---|
| 211 | </indexterm>
|
---|
| 212 |
|
---|
| 213 | </sect3>
|
---|
| 214 |
|
---|
| 215 | <sect3 id='vim-init'>
|
---|
| 216 | <title>Configuration Information</title>
|
---|
| 217 |
|
---|
[6e11352] | 218 | <para><application>Vim</application> has an integrated spell checker
|
---|
| 219 | which you can enable it if you issue the following in a vim window:
|
---|
| 220 | </para>
|
---|
[864b24de] | 221 |
|
---|
[6e11352] | 222 | <screen><literal>:setlocal spell spelllang=ru</literal></screen>
|
---|
[fd7e0ed6] | 223 |
|
---|
[6e11352] | 224 | <para>This setting will enable spell checking for the Russian
|
---|
| 225 | language for the current session.</para>
|
---|
[864b24de] | 226 |
|
---|
[95799899] | 227 | <para>By default, <application>Vim</application> only installs spell
|
---|
[6e11352] | 228 | files for the English language. If a spell file is not available for
|
---|
| 229 | a language, then <application>Vim</application> will call the
|
---|
| 230 | <filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will try
|
---|
| 231 | to obtain the *.spl and optionally *.sug from the vim ftp server,
|
---|
| 232 | by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
|
---|
| 233 | plugin.</para>
|
---|
[864b24de] | 234 |
|
---|
[fcb77dd] | 235 | <!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
|
---|
| 236 | directory -->
|
---|
[95799899] | 237 | <para>Alternatively you can manually download the *.spl and *.sug files
|
---|
| 238 | from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
|
---|
| 239 | them to <filename class="directory"> ~/.vim/spell </filename> or in
|
---|
[fcb77dd] | 240 | <filename class="directory">/usr/share/vim/vim72/spell/</filename>.</para>
|
---|
[864b24de] | 241 |
|
---|
[6e11352] | 242 | <para>To find out what's new in <application>Vim-&vim-version;</application>
|
---|
| 243 | issue the following command:</para>
|
---|
[95799899] | 244 |
|
---|
[6e11352] | 245 | <screen><literal>:help version-&vim-version;</literal></screen>
|
---|
[95799899] | 246 |
|
---|
| 247 | <para>For additional information on setting up
|
---|
| 248 | <application>Vim</application> configuration files, see <xref
|
---|
| 249 | linkend="postlfs-config-vimrc"/> and <ulink
|
---|
[6e11352] | 250 | url='http://www.vi-improved.org/vimrc.php'/>.</para>
|
---|
[95799899] | 251 |
|
---|
| 252 | </sect3>
|
---|
| 253 |
|
---|
[0ec75653] | 254 | </sect2>
|
---|
| 255 |
|
---|
| 256 | <sect2 role="content">
|
---|
| 257 | <title>Contents</title>
|
---|
| 258 |
|
---|
[3aa07d1] | 259 | <para>A list of the reinstalled files, along with their short
|
---|
[95799899] | 260 | descriptions can be found in the <ulink
|
---|
[864b24de] | 261 | url="&lfs-root;/chapter06/vim.html#contents-vim">LFS Vim Installation
|
---|
[98078a63] | 262 | Instructions</ulink></para>
|
---|
[0ec75653] | 263 |
|
---|
| 264 | <segmentedlist>
|
---|
| 265 | <segtitle>Installed Programs</segtitle>
|
---|
| 266 | <segtitle>Installed Libraries</segtitle>
|
---|
| 267 | <segtitle>Installed Directory</segtitle>
|
---|
| 268 |
|
---|
| 269 | <seglistitem>
|
---|
| 270 | <seg>gview, gvim, gvimdiff, rgview, and rgvim</seg>
|
---|
| 271 | <seg>None</seg>
|
---|
| 272 | <seg>/usr/share/vim</seg>
|
---|
| 273 | </seglistitem>
|
---|
| 274 | </segmentedlist>
|
---|
| 275 |
|
---|
| 276 | <variablelist>
|
---|
| 277 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 278 | <?dbfo list-presentation="list"?>
|
---|
| 279 | <?dbhtml list-presentation="table"?>
|
---|
| 280 |
|
---|
| 281 | <varlistentry id="gview">
|
---|
| 282 | <term><command>gview</command></term>
|
---|
| 283 | <listitem>
|
---|
| 284 | <para>starts <command>gvim</command> in read-only mode.</para>
|
---|
| 285 | <indexterm zone="vim gview">
|
---|
| 286 | <primary sortas="b-gview">gview</primary>
|
---|
| 287 | </indexterm>
|
---|
| 288 | </listitem>
|
---|
| 289 | </varlistentry>
|
---|
| 290 |
|
---|
| 291 | <varlistentry id="gvim">
|
---|
| 292 | <term><command>gvim</command></term>
|
---|
| 293 | <listitem>
|
---|
[d612b9f] | 294 | <para>is the editor that runs under <application>X</application>
|
---|
[13679edb] | 295 | and includes a GUI.</para>
|
---|
[0ec75653] | 296 | <indexterm zone="vim gvim">
|
---|
| 297 | <primary sortas="b-gvim">gvim</primary>
|
---|
| 298 | </indexterm>
|
---|
| 299 | </listitem>
|
---|
| 300 | </varlistentry>
|
---|
| 301 |
|
---|
| 302 | <varlistentry id="gvimdiff">
|
---|
| 303 | <term><command>gvimdiff</command></term>
|
---|
| 304 | <listitem>
|
---|
| 305 | <para>edits two or three versions of a file with
|
---|
[13679edb] | 306 | <command>gvim</command> and shows the differences.</para>
|
---|
[0ec75653] | 307 | <indexterm zone="vim gvimdiff">
|
---|
| 308 | <primary sortas="b-gvimdiff">gvimdiff</primary>
|
---|
| 309 | </indexterm>
|
---|
| 310 | </listitem>
|
---|
| 311 | </varlistentry>
|
---|
| 312 |
|
---|
| 313 | <varlistentry id="rgview">
|
---|
| 314 | <term><command>rgview</command></term>
|
---|
| 315 | <listitem>
|
---|
| 316 | <para>is a restricted version of <command>gview</command>.</para>
|
---|
| 317 | <indexterm zone="vim rgview">
|
---|
| 318 | <primary sortas="b-rgview">rgview</primary>
|
---|
| 319 | </indexterm>
|
---|
| 320 | </listitem>
|
---|
| 321 | </varlistentry>
|
---|
| 322 |
|
---|
| 323 | <varlistentry id="rgvim">
|
---|
| 324 | <term><command>rgvim</command></term>
|
---|
| 325 | <listitem>
|
---|
| 326 | <para>is a restricted version of <command>gvim</command>. </para>
|
---|
| 327 | <indexterm zone="vim gvim">
|
---|
| 328 | <primary sortas="b-gvim">gvim</primary>
|
---|
| 329 | </indexterm>
|
---|
| 330 | </listitem>
|
---|
| 331 | </varlistentry>
|
---|
| 332 |
|
---|
| 333 | </variablelist>
|
---|
| 334 |
|
---|
| 335 | </sect2>
|
---|
[f45b1953] | 336 |
|
---|
| 337 | </sect1>
|
---|