2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2004-01-27 22:29:49 +00:00
|
|
|
<sect1 id="ch-system-vim" xreflabel="Vim">
|
2004-05-03 11:59:46 +01:00
|
|
|
<title>Vim-&vim-version;</title>
|
|
|
|
<?dbhtml filename="vim.html"?>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
<para>The Vim package contains a powerful text editor.</para>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<screen>&buildtime; 0.4 SBU
|
|
|
|
&diskspace; 34 MB</screen>
|
|
|
|
|
|
|
|
<para>Vim installation depends on: Bash, Binutils, Coreutils, Diffutils,
|
|
|
|
GCC, Glibc, Grep, Make, Ncurses, Sed.</para>
|
2001-07-17 19:51:18 +01:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
|
|
|
|
|
2003-10-04 11:19:10 +01:00
|
|
|
<sect2>
|
|
|
|
<title>Alternatives to Vim</title>
|
|
|
|
<para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
|
2003-10-07 07:00:35 +01:00
|
|
|
have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
|
2003-10-04 11:19:10 +01:00
|
|
|
suggested installation instructions.</para>
|
|
|
|
</sect2>
|
|
|
|
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Installation of Vim</title>
|
|
|
|
|
2003-11-13 22:30:39 +00:00
|
|
|
<para>First change the default locations of the <filename>vimrc</filename> and
|
2004-05-03 11:59:46 +01:00
|
|
|
<filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
|
|
|
|
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput></screen>
|
|
|
|
|
|
|
|
<para>Now prepare Vim for compilation:</para>
|
|
|
|
|
2004-05-07 17:27:16 +01:00
|
|
|
<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<para>Compile the package:</para>
|
|
|
|
|
|
|
|
<screen><userinput>make</userinput></screen>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>To test the results, you can issue:
|
2004-05-03 22:28:58 +01:00
|
|
|
<userinput>make test</userinput>. However, this test suite outputs a lot of
|
2004-02-07 10:48:55 +00:00
|
|
|
seemingly garbage characters to the screen, and this can wreak havoc with the
|
2004-02-28 11:26:41 +00:00
|
|
|
settings of the current terminal. Therefore the running of the test suite here
|
|
|
|
is strictly optional.</para>
|
2003-12-18 04:08:01 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>Now install the package:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>make install</userinput></screen>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>Many users are used to using <command>vi</command>, instead of
|
|
|
|
<command>vim</command>. To let them execute <command>vim</command> when
|
|
|
|
they habitually enter <command>vi</command>, create a symlink:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
|
|
|
|
|
2003-11-13 22:30:39 +00:00
|
|
|
<para>If you are going to install the X Window system on your LFS system, you
|
|
|
|
may want to re-compile Vim after having installed X. Vim comes with a nice GUI
|
|
|
|
version of the editor that requires X and a few other libraries to be
|
|
|
|
installed. For more information read the Vim documentation.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
</sect2>
|
2003-11-13 22:30:39 +00:00
|
|
|
|
2004-02-09 22:45:54 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<sect2 id="conf-vim"><title>Configuring Vim</title>
|
|
|
|
<indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
|
2004-02-09 22:45:54 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>By default, <command>vim</command> runs in vi-incompatible mode. Some
|
|
|
|
people might not like this, but we prefer to run <command>vim</command> in its
|
2004-02-09 22:45:54 +00:00
|
|
|
own mode (else we wouldn't have included it in this book, but the original
|
2004-05-03 11:59:46 +01:00
|
|
|
<command>vi</command>). We've included the setting of "nocompatible"
|
|
|
|
below to high-light the fact that the new behavior is being used. It
|
|
|
|
also reminds those who would change to "compatible" mode that it should
|
|
|
|
appear first because it changes other settings and overrides must come
|
|
|
|
after this setting. Create a default vim configuration file by running
|
2004-02-09 22:45:54 +00:00
|
|
|
the following:</para>
|
|
|
|
|
|
|
|
<screen><userinput>cat > /etc/vimrc << "EOF"</userinput>
|
|
|
|
" Begin /etc/vimrc
|
|
|
|
|
|
|
|
set nocompatible
|
|
|
|
set backspace=2
|
|
|
|
syntax on
|
|
|
|
|
|
|
|
" End /etc/vimrc
|
|
|
|
<userinput>EOF</userinput></screen>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>The <emphasis>set nocompatible</emphasis> makes
|
|
|
|
<command>vim</command> behave in a more useful way (the default) than the
|
|
|
|
vi-compatible manner. Remove the "no" if you want the old <command>vi</command>
|
|
|
|
behavior. The <emphasis>set backspace=2</emphasis> allows
|
|
|
|
backspacing over line breaks, autoindents and the start of insert. The
|
|
|
|
<emphasis>syntax on</emphasis> enables <command>vim</command>'s
|
|
|
|
semantic coloring.</para>
|
2004-02-09 22:45:54 +00:00
|
|
|
|
|
|
|
</sect2>
|
2003-11-13 22:30:39 +00:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<sect2 id="contents-vim"><title>Contents of Vim</title>
|
|
|
|
|
|
|
|
<para><emphasis>Installed programs</emphasis>: efm_filter.pl, efm_perl.pl, ex
|
|
|
|
(link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim
|
|
|
|
(link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim,
|
|
|
|
vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor
|
|
|
|
and xxd</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2><title>Short descriptions</title>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
|
|
|
|
<para id="efm_filter.pl"><command>efm_filter.pl</command> is a filter for creating an error
|
|
|
|
file that can be read by vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
|
|
|
|
<para id="efm_perl.pl"><command>efm_perl.pl</command> reformats the error messages of the
|
|
|
|
Perl interpreter for use with the <quote>quickfix</quote> mode of vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
|
|
|
|
<para id="ex"><command>ex</command> starts vim in ex mode.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
|
|
|
|
<para id="less.sh"><command>less.sh</command> is a script that starts vim with less.vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
|
|
|
|
<para id="mve.awk"><command>mve.awk</command> processes vim errors.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
|
|
|
|
<para id="pltags.pl"><command>pltags.pl</command> creates a tags file for perl code,
|
|
|
|
for use by vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
|
|
|
|
<para id="ref"><command>ref</command> checks the spelling of arguments.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
|
|
|
|
<para id="rview"><command>rview</command> is a restricted version of view: no shell
|
|
|
|
commands can be started and view can't be suspended.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
|
|
|
|
<para id="rvim"><command>rvim</command> is a restricted version of vim: no shell
|
|
|
|
commands can be started and vim can't be suspended.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
|
|
|
|
<para id="shtags.pl"><command>shtags.pl</command> generates a tag file for perl scripts.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
|
|
|
|
<para id="tcltags"><command>tcltags</command> generates a tag file for TCL code.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
|
|
|
|
<para id="view"><command>view</command> starts vim in read-only mode.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
|
|
|
|
<para id="vim"><command>vim</command> is the editor.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
|
|
|
|
<para id="vim132"><command>vim132</command> starts vim with the terminal in
|
|
|
|
132-column mode.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
|
|
|
|
<para id="vim2html.pl"><command>vim2html.pl</command> converts vim documentation to
|
|
|
|
HTML.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
|
|
|
|
<para id="vimdiff"><command>vimdiff</command> edits two or three versions of a file with
|
|
|
|
vim and show differences.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
|
|
|
|
<para id="vimm"><command>vimm</command> enables the DEC locator input model on a
|
|
|
|
remote terminal.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
|
|
|
|
<para id="vimspell.sh"><command>vimspell.sh</command> is a script which spells a file and generates the syntax
|
|
|
|
statements necessary to highlight in vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
|
|
|
|
<para id="vimtutor"><command>vimtutor</command> teaches you the basic keys and commands
|
|
|
|
of vim.</para>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
|
|
|
|
<para id="xxd"><command>xxd</command> makes a hex dump of the given file. It can
|
|
|
|
also do the reverse, so it can be used for binary patching.</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</sect1>
|