[02095ae] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-vim" role="wrap">
|
---|
| 9 | <?dbhtml filename="vim.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Vim-&vim-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-system-vim">
|
---|
| 14 | <primary sortas="a-Vim">Vim</primary>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 17 | <sect2 role="package">
|
---|
| 18 | <title/>
|
---|
| 19 |
|
---|
| 20 | <para>The Vim package contains a powerful text editor.</para>
|
---|
| 21 |
|
---|
| 22 | <tip>
|
---|
| 23 | <title>Alternatives to Vim</title>
|
---|
| 24 |
|
---|
| 25 | <para>If you prefer another editor—such as Emacs, Joe, or
|
---|
| 26 | Nano—please refer to <ulink
|
---|
| 27 | url="&blfs-root;view/svn/postlfs/editors.html"/>
|
---|
| 28 | for suggested installation instructions.</para>
|
---|
| 29 | </tip>
|
---|
| 30 |
|
---|
| 31 | </sect2>
|
---|
| 32 |
|
---|
| 33 | <sect2 role="installation">
|
---|
| 34 | <title>Installation of Vim</title>
|
---|
| 35 |
|
---|
| 36 | <para os="a">First, unpack both <filename>vim-&vim-version;.tar.bz2</filename>
|
---|
| 37 | and (optionally) <filename>vim-&vim-version;-lang.tar.gz</filename>
|
---|
| 38 | archives into the same directory.</para>
|
---|
| 39 |
|
---|
[817bb11] | 40 | <para os="p1">The following patch fixes numerous issues with
|
---|
| 41 | cross-compiling vim</para>
|
---|
| 42 |
|
---|
| 43 | <screen os="p2"><userinput>patch -Np1 -i ../&vim-cross_compile-patch;</userinput></screen>
|
---|
| 44 |
|
---|
| 45 | <para os="p3">The following patch contains updates from the maintainer. The
|
---|
[02095ae] | 46 | maintainer of Vim only releases these patches to fix serious issues.</para>
|
---|
| 47 |
|
---|
[817bb11] | 48 | <screen os="p4"><userinput>patch -Np1 -i ../&vim-fixes-patch;</userinput></screen>
|
---|
[02095ae] | 49 |
|
---|
| 50 | <para os="b">Change the default location of
|
---|
| 51 | the <filename>vimrc</filename> configuration file to <filename
|
---|
| 52 | class="directory">/etc</filename>:</para>
|
---|
| 53 |
|
---|
| 54 | <screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen>
|
---|
| 55 |
|
---|
| 56 | <para os="d">Prepare Vim for compilation:</para>
|
---|
| 57 |
|
---|
[817bb11] | 58 | <screen os="e"><userinput>./configure --prefix=/usr --host=${LFS_TARGET} \
|
---|
| 59 | --enable-multibyte --enable-gui=no \
|
---|
| 60 | --disable-gtktest --disable-xim \
|
---|
| 61 | --with-features=normal --disable-gpm \
|
---|
| 62 | --without-x --disable-netbeans \
|
---|
| 63 | --with-tlib=ncurses</userinput></screen>
|
---|
[02095ae] | 64 |
|
---|
| 65 | <variablelist os="f">
|
---|
| 66 | <title>The meaning of the configure options:</title>
|
---|
| 67 |
|
---|
| 68 | <varlistentry>
|
---|
| 69 | <term><parameter>--enable-multibyte</parameter></term>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>This optional but highly recommended switch enables support
|
---|
| 72 | for editing files in multibyte character encodings. This is needed
|
---|
| 73 | if using a locale with a multibyte character set. This switch is
|
---|
| 74 | also helpful to be able to edit text files initially created in
|
---|
| 75 | Linux distributions like Fedora Core that use UTF-8 as a default
|
---|
| 76 | character set.</para>
|
---|
| 77 | </listitem>
|
---|
| 78 | </varlistentry>
|
---|
| 79 |
|
---|
| 80 | </variablelist>
|
---|
| 81 |
|
---|
| 82 | <para os="g">Compile the package:</para>
|
---|
| 83 |
|
---|
| 84 | <screen os="h"><userinput>make</userinput></screen>
|
---|
| 85 |
|
---|
[817bb11] | 86 | <para os="i">Install the package:</para>
|
---|
[02095ae] | 87 |
|
---|
[817bb11] | 88 | <screen os="j"><userinput>make DESTDIR=${LFS} install</userinput></screen>
|
---|
[02095ae] | 89 |
|
---|
[817bb11] | 90 | <para os="k">Many users are used to using <command>vi</command> instead of
|
---|
[02095ae] | 91 | <command>vim</command>. To allow execution of <command>vim</command>
|
---|
| 92 | when users habitually enter <command>vi</command>, create a
|
---|
| 93 | symlink:</para>
|
---|
| 94 |
|
---|
[817bb11] | 95 | <screen os="l"><userinput>ln -sv vim ${LFS}/usr/bin/vi</userinput></screen>
|
---|
[02095ae] | 96 |
|
---|
[817bb11] | 97 | <para os="m">By default, Vim's documentation is installed in
|
---|
[02095ae] | 98 | <filename class="directory">/usr/share/vim</filename>. The following symlink
|
---|
| 99 | allows the documentation to be accessed via
|
---|
| 100 | <filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
|
---|
| 101 | it consistent with the location of documentation for other packages:</para>
|
---|
| 102 |
|
---|
[817bb11] | 103 | <screen os="n"><userinput>ln -sv ../vim/vim&vim-version2;/doc ${LFS}/usr/share/doc/vim-&vim-version;</userinput></screen>
|
---|
[02095ae] | 104 |
|
---|
| 105 | <para os="p">If an X Window System is going to be installed on the LFS
|
---|
| 106 | system, it may be necessary to recompile Vim after installing X. Vim
|
---|
| 107 | comes with a GUI version of the editor that requires X and some
|
---|
| 108 | additional libraries to be installed. For more information on this
|
---|
| 109 | process, refer to the Vim documentation and the Vim installation page
|
---|
| 110 | in the BLFS book at <ulink
|
---|
| 111 | url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
|
---|
| 112 |
|
---|
| 113 | </sect2>
|
---|
| 114 |
|
---|
| 115 | <sect2 id="conf-vim" role="configuration">
|
---|
| 116 | <title>Configuring Vim</title>
|
---|
| 117 |
|
---|
| 118 | <indexterm zone="conf-vim">
|
---|
| 119 | <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
|
---|
| 120 | </indexterm>
|
---|
| 121 |
|
---|
| 122 | <para>By default, <command>vim</command> runs in vi-incompatible mode.
|
---|
| 123 | This may be new to users who have used other editors in the past. The
|
---|
| 124 | <quote>nocompatible</quote> setting is included below to highlight the
|
---|
| 125 | fact that a new behavior is being used. It also reminds those who would
|
---|
| 126 | change to <quote>compatible</quote> mode that it should be the first
|
---|
| 127 | setting in the configuration file. This is necessary because it changes
|
---|
| 128 | other settings, and overrides must come after this setting. Create a
|
---|
| 129 | default <command>vim</command> configuration file by running the
|
---|
| 130 | following:</para>
|
---|
| 131 |
|
---|
[817bb11] | 132 | <screen><userinput>cat > ${LFS}/etc/vimrc << "EOF"
|
---|
[02095ae] | 133 | <literal>" Begin /etc/vimrc
|
---|
| 134 |
|
---|
| 135 | set nocompatible
|
---|
| 136 | set backspace=2
|
---|
| 137 | syntax on
|
---|
| 138 | if (&term == "iterm") || (&term == "putty")
|
---|
| 139 | set background=dark
|
---|
| 140 | endif
|
---|
| 141 |
|
---|
| 142 | " End /etc/vimrc</literal>
|
---|
| 143 | EOF</userinput></screen>
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 | <para>The <parameter>set nocompatible</parameter> makes
|
---|
| 147 | <command>vim</command> behave in a more useful way (the default) than
|
---|
| 148 | the vi-compatible manner. Remove the <quote>no</quote> to keep the
|
---|
| 149 | old <command>vi</command> behavior. The <parameter>set
|
---|
| 150 | backspace=2</parameter> allows backspacing over line breaks,
|
---|
| 151 | autoindents, and the start of insert. The <parameter>syntax
|
---|
| 152 | on</parameter> enables vim's syntax highlighting. Finally, the
|
---|
| 153 | <emphasis>if</emphasis> statement with the <parameter>set
|
---|
| 154 | background=dark</parameter> corrects <command>vim</command>'s guess
|
---|
| 155 | about the background color of some terminal emulators. This gives the
|
---|
| 156 | highlighting a better color scheme for use on the black background of
|
---|
| 157 | these programs.</para>
|
---|
| 158 |
|
---|
| 159 | <para>Documentation for other available options can be obtained by
|
---|
| 160 | running the following command:</para>
|
---|
| 161 |
|
---|
| 162 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
|
---|
| 163 |
|
---|
| 164 | </sect2>
|
---|
| 165 |
|
---|
| 166 | <sect2 id="contents-vim" role="content">
|
---|
| 167 | <title>Contents of Vim</title>
|
---|
| 168 |
|
---|
| 169 | <segmentedlist>
|
---|
| 170 | <segtitle>Installed programs</segtitle>
|
---|
| 171 |
|
---|
| 172 | <seglistitem>
|
---|
| 173 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
| 174 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
|
---|
| 175 | tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
|
---|
| 176 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
|
---|
| 177 | </seglistitem>
|
---|
| 178 | </segmentedlist>
|
---|
| 179 |
|
---|
| 180 | <variablelist>
|
---|
| 181 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 182 | <?dbfo list-presentation="list"?>
|
---|
| 183 | <?dbhtml list-presentation="table"?>
|
---|
| 184 |
|
---|
| 185 | <varlistentry id="efm_filter.pl">
|
---|
| 186 | <term><command>efm_filter.pl</command></term>
|
---|
| 187 | <listitem>
|
---|
| 188 | <para>A filter for creating an error file that can be read
|
---|
| 189 | by <command>vim</command></para>
|
---|
| 190 | <indexterm zone="ch-system-vim efm_filter.pl">
|
---|
| 191 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
|
---|
| 192 | </indexterm>
|
---|
| 193 | </listitem>
|
---|
| 194 | </varlistentry>
|
---|
| 195 |
|
---|
| 196 | <varlistentry id="efm_perl.pl">
|
---|
| 197 | <term><command>efm_perl.pl</command></term>
|
---|
| 198 | <listitem>
|
---|
| 199 | <para>Reformats the error messages of the Perl interpreter for use
|
---|
| 200 | with the <quote>quickfix</quote> mode of <command>vim</command></para>
|
---|
| 201 | <indexterm zone="ch-system-vim efm_perl.pl">
|
---|
| 202 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
|
---|
| 203 | </indexterm>
|
---|
| 204 | </listitem>
|
---|
| 205 | </varlistentry>
|
---|
| 206 |
|
---|
| 207 | <varlistentry id="ex">
|
---|
| 208 | <term><command>ex</command></term>
|
---|
| 209 | <listitem>
|
---|
| 210 | <para>Starts <command>vim</command> in ex mode</para>
|
---|
| 211 | <indexterm zone="ch-system-vim ex">
|
---|
| 212 | <primary sortas="b-ex">ex</primary>
|
---|
| 213 | </indexterm>
|
---|
| 214 | </listitem>
|
---|
| 215 | </varlistentry>
|
---|
| 216 |
|
---|
| 217 | <varlistentry id="less.sh">
|
---|
| 218 | <term><command>less.sh</command></term>
|
---|
| 219 | <listitem>
|
---|
| 220 | <para>A script that starts <command>vim</command> with less.vim</para>
|
---|
| 221 | <indexterm zone="ch-system-vim less.sh">
|
---|
| 222 | <primary sortas="b-less.sh">less.sh</primary>
|
---|
| 223 | </indexterm>
|
---|
| 224 | </listitem>
|
---|
| 225 | </varlistentry>
|
---|
| 226 |
|
---|
| 227 | <varlistentry id="mve.awk">
|
---|
| 228 | <term><command>mve.awk</command></term>
|
---|
| 229 | <listitem>
|
---|
| 230 | <para>Processes <command>vim</command> errors</para>
|
---|
| 231 | <indexterm zone="ch-system-vim mve.awk">
|
---|
| 232 | <primary sortas="b-mve.awk">mve.awk</primary>
|
---|
| 233 | </indexterm>
|
---|
| 234 | </listitem>
|
---|
| 235 | </varlistentry>
|
---|
| 236 |
|
---|
| 237 | <varlistentry id="pltags.pl">
|
---|
| 238 | <term><command>pltags.pl</command></term>
|
---|
| 239 | <listitem>
|
---|
| 240 | <para>Creates a tags file for Perl code for use by
|
---|
| 241 | <command>vim</command></para>
|
---|
| 242 | <indexterm zone="ch-system-vim pltags.pl">
|
---|
| 243 | <primary sortas="b-pltags.pl">pltags.pl</primary>
|
---|
| 244 | </indexterm>
|
---|
| 245 | </listitem>
|
---|
| 246 | </varlistentry>
|
---|
| 247 |
|
---|
| 248 | <varlistentry id="ref">
|
---|
| 249 | <term><command>ref</command></term>
|
---|
| 250 | <listitem>
|
---|
| 251 | <para>Checks the spelling of arguments</para>
|
---|
| 252 | <indexterm zone="ch-system-vim ref">
|
---|
| 253 | <primary sortas="b-ref">ref</primary>
|
---|
| 254 | </indexterm>
|
---|
| 255 | </listitem>
|
---|
| 256 | </varlistentry>
|
---|
| 257 |
|
---|
| 258 | <varlistentry id="rview">
|
---|
| 259 | <term><command>rview</command></term>
|
---|
| 260 | <listitem>
|
---|
| 261 | <para>Is a restricted version of <command>view</command>; no shell
|
---|
| 262 | commands can be started and <command>view</command> cannot be
|
---|
| 263 | suspended</para>
|
---|
| 264 | <indexterm zone="ch-system-vim rview">
|
---|
| 265 | <primary sortas="b-rview">rview</primary>
|
---|
| 266 | </indexterm>
|
---|
| 267 | </listitem>
|
---|
| 268 | </varlistentry>
|
---|
| 269 |
|
---|
| 270 | <varlistentry id="rvim">
|
---|
| 271 | <term><command>rvim</command></term>
|
---|
| 272 | <listitem>
|
---|
| 273 | <para>Is a restricted version of <command>vim</command>; no shell
|
---|
| 274 | commands can be started and <command>vim</command> cannot be
|
---|
| 275 | suspended</para>
|
---|
| 276 | <indexterm zone="ch-system-vim rvim">
|
---|
| 277 | <primary sortas="b-rvim">rvim</primary>
|
---|
| 278 | </indexterm>
|
---|
| 279 | </listitem>
|
---|
| 280 | </varlistentry>
|
---|
| 281 |
|
---|
| 282 | <varlistentry id="shtags.pl">
|
---|
| 283 | <term><command>shtags.pl</command></term>
|
---|
| 284 | <listitem>
|
---|
| 285 | <para>Generates a tags file for Perl scripts</para>
|
---|
| 286 | <indexterm zone="ch-system-vim shtags.pl">
|
---|
| 287 | <primary sortas="b-shtags.pl">shtags.pl</primary>
|
---|
| 288 | </indexterm>
|
---|
| 289 | </listitem>
|
---|
| 290 | </varlistentry>
|
---|
| 291 |
|
---|
| 292 | <varlistentry id="tcltags">
|
---|
| 293 | <term><command>tcltags</command></term>
|
---|
| 294 | <listitem>
|
---|
| 295 | <para>Generates a tags file for TCL code</para>
|
---|
| 296 | <indexterm zone="ch-system-vim tcltags">
|
---|
| 297 | <primary sortas="b-tcltags">tcltags</primary>
|
---|
| 298 | </indexterm>
|
---|
| 299 | </listitem>
|
---|
| 300 | </varlistentry>
|
---|
| 301 |
|
---|
| 302 | <varlistentry id="view">
|
---|
| 303 | <term><command>view</command></term>
|
---|
| 304 | <listitem>
|
---|
| 305 | <para>Starts <command>vim</command> in read-only mode</para>
|
---|
| 306 | <indexterm zone="ch-system-vim view">
|
---|
| 307 | <primary sortas="b-view">view</primary>
|
---|
| 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
| 310 | </varlistentry>
|
---|
| 311 |
|
---|
| 312 | <varlistentry id="vi">
|
---|
| 313 | <term><command>vi</command></term>
|
---|
| 314 | <listitem>
|
---|
| 315 | <para>Link to <command>vim</command></para>
|
---|
| 316 | <indexterm zone="ch-system-vim vi">
|
---|
| 317 | <primary sortas="b-vi">vi</primary>
|
---|
| 318 | </indexterm>
|
---|
| 319 | </listitem>
|
---|
| 320 | </varlistentry>
|
---|
| 321 |
|
---|
| 322 | <varlistentry id="vim">
|
---|
| 323 | <term><command>vim</command></term>
|
---|
| 324 | <listitem>
|
---|
| 325 | <para>Is the editor</para>
|
---|
| 326 | <indexterm zone="ch-system-vim vim">
|
---|
| 327 | <primary sortas="b-vim">vim</primary>
|
---|
| 328 | </indexterm>
|
---|
| 329 | </listitem>
|
---|
| 330 | </varlistentry>
|
---|
| 331 |
|
---|
| 332 | <varlistentry id="vim132">
|
---|
| 333 | <term><command>vim132</command></term>
|
---|
| 334 | <listitem>
|
---|
| 335 | <para>Starts <command>vim</command> with the terminal in 132-column
|
---|
| 336 | mode</para>
|
---|
| 337 | <indexterm zone="ch-system-vim vim132">
|
---|
| 338 | <primary sortas="b-vim132">vim132</primary>
|
---|
| 339 | </indexterm>
|
---|
| 340 | </listitem>
|
---|
| 341 | </varlistentry>
|
---|
| 342 |
|
---|
| 343 | <varlistentry id="vim2html.pl">
|
---|
| 344 | <term><command>vim2html.pl</command></term>
|
---|
| 345 | <listitem>
|
---|
| 346 | <para>Converts Vim documentation to HypterText Markup Language
|
---|
| 347 | (HTML)</para>
|
---|
| 348 | <indexterm zone="ch-system-vim vim2html.pl">
|
---|
| 349 | <primary sortas="b-vim2html.pl">vim2html.pl</primary>
|
---|
| 350 | </indexterm>
|
---|
| 351 | </listitem>
|
---|
| 352 | </varlistentry>
|
---|
| 353 |
|
---|
| 354 | <varlistentry id="vimdiff">
|
---|
| 355 | <term><command>vimdiff</command></term>
|
---|
| 356 | <listitem>
|
---|
| 357 | <para>Edits two or three versions of a file with <command>vim</command>
|
---|
| 358 | and show differences</para>
|
---|
| 359 | <indexterm zone="ch-system-vim vimdiff">
|
---|
| 360 | <primary sortas="b-vimdiff">vimdiff</primary>
|
---|
| 361 | </indexterm>
|
---|
| 362 | </listitem>
|
---|
| 363 | </varlistentry>
|
---|
| 364 |
|
---|
| 365 | <varlistentry id="vimm">
|
---|
| 366 | <term><command>vimm</command></term>
|
---|
| 367 | <listitem>
|
---|
| 368 | <para>Enables the DEC locator input model on a remote terminal</para>
|
---|
| 369 | <indexterm zone="ch-system-vim vimm">
|
---|
| 370 | <primary sortas="b-vimm">vimm</primary>
|
---|
| 371 | </indexterm>
|
---|
| 372 | </listitem>
|
---|
| 373 | </varlistentry>
|
---|
| 374 |
|
---|
| 375 | <varlistentry id="vimspell.sh">
|
---|
| 376 | <term><command>vimspell.sh</command></term>
|
---|
| 377 | <listitem>
|
---|
| 378 | <para>Spell checks a file and generates the syntax statements
|
---|
| 379 | necessary to highlight in <command>vim</command>. This script
|
---|
| 380 | requires the old Unix <command>spell</command> command, which
|
---|
| 381 | is provided neither in LFS nor in BLFS</para>
|
---|
| 382 | <indexterm zone="ch-system-vim vimspell.sh">
|
---|
| 383 | <primary sortas="b-vimspell.sh">vimspell.sh</primary>
|
---|
| 384 | </indexterm>
|
---|
| 385 | </listitem>
|
---|
| 386 | </varlistentry>
|
---|
| 387 |
|
---|
| 388 | <varlistentry id="vimtutor">
|
---|
| 389 | <term><command>vimtutor</command></term>
|
---|
| 390 | <listitem>
|
---|
| 391 | <para>Teaches the basic keys and commands of
|
---|
| 392 | <command>vim</command></para>
|
---|
| 393 | <indexterm zone="ch-system-vim vimtutor">
|
---|
| 394 | <primary sortas="b-vimtutor">vimtutor</primary>
|
---|
| 395 | </indexterm>
|
---|
| 396 | </listitem>
|
---|
| 397 | </varlistentry>
|
---|
| 398 |
|
---|
| 399 | <varlistentry id="xxd">
|
---|
| 400 | <term><command>xxd</command></term>
|
---|
| 401 | <listitem>
|
---|
| 402 | <para>Creates a hex dump of the given file; it can
|
---|
| 403 | also do the reverse, so it can be used for binary patching</para>
|
---|
| 404 | <indexterm zone="ch-system-vim xxd">
|
---|
| 405 | <primary sortas="b-xxd">xxd</primary>
|
---|
| 406 | </indexterm>
|
---|
| 407 | </listitem>
|
---|
| 408 | </varlistentry>
|
---|
| 409 |
|
---|
| 410 | </variablelist>
|
---|
| 411 |
|
---|
| 412 | </sect2>
|
---|
| 413 |
|
---|
| 414 | </sect1>
|
---|