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