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