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