| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 | <?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;]><sect1 id="ch-system-vim" xreflabel="Vim" role="wrap"><title>Vim-&vim-version;</title><?dbhtml filename="vim.html"?><indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm><sect2 role="package"><title/><para>The Vim package contains a powerful text editor.</para><segmentedlist><segtitle>&buildtime;</segtitle><segtitle>&diskspace;</segtitle><seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem></segmentedlist><segmentedlist><segtitle>Vim installation depends on</segtitle><seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,GCC, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem></segmentedlist><tip><title>Alternatives to Vim</title><para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> forsuggested installation instructions.</para></tip></sect2><sect2 role="installation"><title>Installation of Vim</title><para>First, unpack both<filename>vim-&vim-version;.tar.bz2</filename> and (optionally)<filename>vim-&vim-version;-lang.tar.gz</filename> archives into the samedirectory. Then change the default locations of the <filename>vimrc</filename> and<filename>gvimrc</filename> configuration files to <filename class="directory">/etc</filename>.</para><screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.hecho '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput></screen><para>Now prepare Vim for compilation:</para><screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen><para>The optional but highly recommended<userinput>--enable-multibyte</userinput> switchincludes support for editing files in multibyte character encodings into<command>vim</command>.It is needed for those people who ignore our recommendation not touse LFS in locales with multibyte character sets. It is also needed forpeople who want to be able to edit text files initially createdin Linux distributions like Fedora Corethat use UTF-8 as a default character set.</para><para>Compile the package:</para><screen><userinput>make</userinput></screen><para>To test the results, you can issue:<userinput>make test</userinput>. However, this test suite outputs a lot ofseemingly garbage characters to the screen, and this can wreak havoc with thesettings of the current terminal. Therefore the running of the test suite hereis strictly optional.</para><para>Now install the package:</para><screen><userinput>make install</userinput></screen><para>Many users are used to using <command>vi</command>, instead of<command>vim</command>. To let them execute <command>vim</command> whenthey habitually enter <command>vi</command>, create a symlink:</para><screen><userinput>ln -s vim /usr/bin/vi</userinput></screen><para>If you are going to install the X Window system on your LFS system, youmay want to re-compile Vim after having installed X. Vim comes with a nice GUIversion of the editor that requires X and a few other libraries to beinstalled. For more information read the Vim documentation.</para></sect2><sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title><indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm><para>By default, <command>vim</command> runs in vi-incompatible mode. Somepeople might not like this, but we prefer to run <command>vim</command> in itsown mode (else we wouldn't have included it in this book, but the original<command>vi</command>). We've included the setting of "nocompatible"below to high-light the fact that the new behavior is being used. Italso reminds those who would change to "compatible" mode that it shouldappear first because it changes other settings and overrides must comeafter this setting. Create a default vim configuration file by runningthe following:</para><screen><userinput>cat > /etc/vimrc << "EOF"</userinput>" Begin /etc/vimrcset nocompatibleset backspace=2syntax on<!-- set fileencodings=ucs-bom,utf-8,<replaceable>your-8-bit-charset</replaceable> -->if (&term == "iterm") || (&term == "putty")  set background=darkendif" End /etc/vimrc<userinput>EOF</userinput></screen><para>The <emphasis>set nocompatible</emphasis> makes<command>vim</command> behave in a more useful way (the default) than thevi-compatible manner. Remove the "no" if you want the old <command>vi</command>behavior. The <emphasis>set backspace=2</emphasis> allowsbackspacing over line breaks, autoindents and the start of insert. The<emphasis>syntax on</emphasis> enables <command>vim</command>'ssyntax highliting.<!-- XXX: the ascii-only files are considered to be in utf-8 - that's not whatone expects . That's why fileencodings stuff is commented out for nowThe <emphasis>set fileencodings=...</emphasis> makes<command>vim</command> capable of automatically detecting the characterset of the file being edited (replace"<replaceable>your-8-bit-charset</replaceable>"with the value appropriate for your country, e.g. iso-8859-15 in Italy).This line is useful because bleeding-edge distributionslike Fedora Core use UTF-8, and conservative ones like Debianuse traditional 8-bit encodings for text files. If you have notpassed the <option>- -enable-multibyte</option> switch to the<command>./configure</command> command above, this line will not work. -->Finally, the <emphasis>if</emphasis> statement with the<emphasis>set background=dark</emphasis> corrects <command>vim</command>'sguess about the background color of some terminal emulators. This gives thehighliting a better color scheme for use on the black background ofthese programs.</para><para>Documentation for other available options can be obtained by runningthe following command:</para><screen><userinput>vim -c ':options'</userinput></screen></sect2><sect2 id="contents-vim" role="content"><title>Contents of Vim</title><segmentedlist><segtitle>Installed programs</segtitle><seglistitem><seg>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</seg></seglistitem></segmentedlist><variablelist><title>Short descriptions</title><varlistentry id="efm_filter.pl"><term><command>efm_filter.pl</command></term><listitem><indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm><para>is a filter for creating an error file that can be read by vim.</para></listitem></varlistentry><varlistentry id="efm_perl.pl"><term><command>efm_perl.pl</command></term><listitem><indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm><para>reformats the error messages of thePerl interpreter for use with the <quote>quickfix</quote> mode of vim.</para></listitem></varlistentry><varlistentry id="ex"><term><command>ex</command></term><listitem><indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm><para>starts vim in ex mode.</para></listitem></varlistentry><varlistentry id="less.sh"><term><command>less.sh</command></term><listitem><indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm><para>is a script that starts vim with less.vim.</para></listitem></varlistentry><varlistentry id="mve.awk"><term><command>mve.awk</command></term><listitem><indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm><para>processes vim errors.</para></listitem></varlistentry><varlistentry id="pltags.pl"><term><command>pltags.pl</command></term><listitem><indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm><para>creates a tags file for perl code, for use by vim.</para></listitem></varlistentry><varlistentry id="ref"><term><command>ref</command></term><listitem><indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm><para>checks the spelling of arguments.</para></listitem></varlistentry><varlistentry id="rview"><term><command>rview</command></term><listitem><indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm><para>is a restricted version of view: no shellcommands can be started and view can't be suspended.</para></listitem></varlistentry><varlistentry id="rvim"><term><command>rvim</command></term><listitem><indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm><para>is a restricted version of vim: no shellcommands can be started and vim can't be suspended.</para></listitem></varlistentry><varlistentry id="shtags.pl"><term><command>shtags.pl</command></term><listitem><indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm><para>generates a tag file for perl scripts.</para></listitem></varlistentry><varlistentry id="tcltags"><term><command>tcltags</command></term><listitem><indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm><para>generates a tag file for TCL code.</para></listitem></varlistentry><varlistentry id="view"><term><command>view</command></term><listitem><indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm><para>starts vim in read-only mode.</para></listitem></varlistentry><varlistentry id="vim"><term><command>vim</command></term><listitem><indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm><para>is the editor.</para></listitem></varlistentry><varlistentry id="vim132"><term><command>vim132</command></term><listitem><indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm><para>starts vim with the terminal in 132-column mode.</para></listitem></varlistentry><varlistentry id="vim2html.pl"><term><command>vim2html.pl</command></term><listitem><indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm><para>converts vim documentation to HTML.</para></listitem></varlistentry><varlistentry id="vimdiff"><term><command>vimdiff</command></term><listitem><indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm><para>edits two or three versions of a file with vim and show differences.</para></listitem></varlistentry><varlistentry id="vimm"><term><command>vimm</command></term><listitem><indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm><para>enables the DEC locator input model on a remote terminal.</para></listitem></varlistentry><varlistentry id="vimspell.sh"><term><command>vimspell.sh</command></term><listitem><indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm><para>is a script which spells a file and generates the syntax statements necessary to highlight in vim. This script requires the old Unix <command>spell</command> command, which is provided neither in LFS nor in BLFS.</para></listitem></varlistentry><varlistentry id="vimtutor"><term><command>vimtutor</command></term><listitem><indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm><para>teaches you the basic keys and commands of vim.</para></listitem></varlistentry><varlistentry id="xxd"><term><command>xxd</command></term><listitem><indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm><para>makes a hex dump of the given file. It canalso do the reverse, so it can be used for binary patching.</para></listitem></varlistentry></variablelist></sect2></sect1>
 |