mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-25 07:42:13 +08:00
57e1c095d8
Update vim version to match LFS git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22036 af4574ff-66df-0310-9fd7-8a98e5e911e0
356 lines
13 KiB
XML
356 lines
13 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!-- only for initial releases of a new version
|
|
<!ENTITY vim-download-http "http://ftp.vim.org/vim/unix/vim-&vim-version;.tar.bz2">-->
|
|
<!ENTITY vim-download-http "http://github.com/vim/vim/archive/v&vim-version;/vim-&vim-version;.tar.gz">
|
|
<!ENTITY vim-download-ftp " ">
|
|
<!ENTITY vim-md5sum "4f129a05254d93c739fcede843df87df">
|
|
<!ENTITY vim-size "14.0 MB">
|
|
<!ENTITY vim-buildsize "103 MB">
|
|
<!ENTITY vim-time "0.3 SBU (Using parallelism=4; add 1.2 SBU for tests)">
|
|
]>
|
|
|
|
<sect1 id="vim" xreflabel="Vim-&vim-version;">
|
|
<?dbhtml filename="vim.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>Vim-&vim-version;</title>
|
|
|
|
<indexterm zone="vim">
|
|
<primary sortas="a-Vim">Vim</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to Vim</title>
|
|
|
|
<para>The <application>Vim</application> package, which is an
|
|
abbreviation for VI IMproved, contains a <command>vi</command>
|
|
clone with extra features as compared to the original
|
|
<command>vi</command>.</para>
|
|
|
|
<para>The default LFS instructions install <application>vim</application>
|
|
as a part of the base system. If you would prefer to link
|
|
<application>vim</application> against <application>X</application>,
|
|
you should recompile <application>vim</application> to enable GUI mode.
|
|
There is no need for special instructions since
|
|
<application>X</application> support is automatically detected.</para>
|
|
|
|
&lfs90_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Download (HTTP): <ulink url="&vim-download-http;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download (FTP): <ulink url="&vim-download-ftp;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download MD5 sum: &vim-md5sum;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download size: &vim-size;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated disk space required: &vim-buildsize;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated build time: &vim-time;</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">Vim Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Recommended</bridgehead>
|
|
<para role="recommended">
|
|
<xref linkend="x-window-system"/> and
|
|
<xref linkend="gtk2"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="gpm"/>,
|
|
<xref linkend="lua"/>,
|
|
<xref linkend="python2"/>,
|
|
<xref linkend="ruby"/>, and
|
|
<xref linkend="tcl"/>
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
<ulink url="&blfs-wiki;/vim"/></para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of Vim</title>
|
|
|
|
<note>
|
|
<para>If you recompile <application>Vim</application> to link against
|
|
<application>X</application> and your <application>X</application>
|
|
libraries are not on the root partition, you will no longer have an
|
|
editor for use in emergencies. You may choose to install an additional
|
|
editor, not link <application>Vim</application> against
|
|
<application>X</application>, or move the current <command>vim</command>
|
|
executable to the <filename class="directory">/bin</filename> directory
|
|
under a different name such as <filename>vi</filename>.</para>
|
|
</note>
|
|
|
|
<para>Install <application>Vim</application> by running the following
|
|
commands:</para>
|
|
|
|
<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
|
|
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
|
|
|
|
./configure --prefix=/usr \
|
|
--with-features=huge \
|
|
--with-tlib=ncursesw &&
|
|
make</userinput></screen>
|
|
|
|
<para>To test the results, issue: <command>make test</command>.
|
|
The <application>vim</application> test suite outputs a lot of binary
|
|
data to the screen, which can cause issues with the settings of the
|
|
current terminal. This can be resolved by redirecting the output to a
|
|
log file. Even if one of the tests fails to produce the file
|
|
<filename>test.out</filename> in <filename
|
|
class="directory">src/testdir</filename>, the remaining tests will still
|
|
be executed. If all goes well,the log will report <literal>ALL DONE</literal>.
|
|
<emphasis>Note</emphasis>: Some color tests
|
|
expect to be executed under the <command>xterm</command> terminal
|
|
emulator. Three tests are known to fail occasionally and can be ignored.</para>
|
|
|
|
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
|
|
|
<screen role="root"><userinput>make install</userinput></screen>
|
|
|
|
<para>By default, Vim's documentation is installed in <filename
|
|
class="directory">/usr/share/vim</filename>. The following symlink allows
|
|
the documentation to be accessed via <filename
|
|
class="directory">/usr/share/doc/vim-&vim-version;</filename>, making it
|
|
consistent with the location of documentation for other packages:</para>
|
|
|
|
<!-- When updating, be sure to change the vim-majmin entity for the
|
|
proper 'vimxx' unpacked directory -->
|
|
|
|
<screen role="root"><userinput>ln -snfv ../vim/vim&vim-majmin;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
|
|
|
|
<para>If you wish to update the runtime files, issue the
|
|
following command (requires <xref linkend="rsync"/>):</para>
|
|
|
|
<screen><userinput>rsync -avzcP --exclude="/dos/" --exclude="/spell/" \
|
|
ftp.nluug.nl::Vim/runtime/ ./runtime/</userinput></screen>
|
|
|
|
<para>To install the runtime files and regenerate the
|
|
<filename>tags</filename> file, as the
|
|
<systemitem class="username">root</systemitem> user issue:</para>
|
|
|
|
<screen role="root"><userinput>make -C src installruntime &&
|
|
vim -c ":helptags /usr/share/doc/vim-&vim-version;" -c ":q"</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para><parameter>--with-features=huge</parameter>: This switch enables all
|
|
the additional features available in <application>Vim</application>,
|
|
including support for multibyte characters.</para>
|
|
|
|
<para>
|
|
<parameter>--with-tlib=ncursesw</parameter>: This switch forces Vim to
|
|
link against the <filename class="libraryfile">libncursesw</filename>
|
|
library.
|
|
</para>
|
|
|
|
<para><option>--enable-gui=no</option>: This will prevent compilation of the
|
|
GUI. <application>Vim</application> will still link against
|
|
<application>X</application>, so that some features such as the client-server
|
|
model or the x11-selection (clipboard) are still available.</para>
|
|
|
|
<para><option>--without-x</option>: If you prefer not to link
|
|
<application>Vim</application> against <application>X</application>, use
|
|
this switch.</para>
|
|
|
|
<para><option>--enable-perlinterp</option>, <option>--enable-pythoninterp</option>,
|
|
<option>--enable-tclinterp</option>, <option>--enable-rubyinterp</option>:
|
|
These options include the Perl, Python, Tcl, or Ruby interpreters that allow
|
|
using other application code in <application>vim</application> scripts.</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring Vim</title>
|
|
|
|
<sect3 id='vim-config'>
|
|
<title>Config Files</title>
|
|
|
|
<para><filename>/etc/vimrc</filename> and
|
|
<filename>~/.vimrc</filename></para>
|
|
|
|
<indexterm zone="vim vim-config">
|
|
<primary sortas="e-etc-vimrc">/etc/vimrc</primary>
|
|
</indexterm>
|
|
|
|
<indexterm zone="vim vim-config">
|
|
<primary sortas="e-AA.vimrc">~/.vimrc</primary>
|
|
</indexterm>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id='vim-desktop'>
|
|
<title>Desktop File</title>
|
|
|
|
<para>
|
|
If desired, create a menu entry for graphical vim,
|
|
<filename>gvim.desktop</filename>, as the <systemitem
|
|
class="username">root</systemitem> user
|
|
</para>
|
|
|
|
<screen role="root"><userinput>cat > /usr/share/applications/gvim.desktop << "EOF"
|
|
<literal>[Desktop Entry]
|
|
Name=GVim Text Editor
|
|
Comment=Edit text files
|
|
Comment[pt_BR]=Edite arquivos de texto
|
|
TryExec=gvim
|
|
Exec=gvim -f %F
|
|
Terminal=false
|
|
Type=Application
|
|
Icon=gvim.png
|
|
Categories=Utility;TextEditor;
|
|
StartupNotify=true
|
|
MimeType=text/plain;</literal>
|
|
EOF</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id='vim-init'>
|
|
<title>Configuration Information</title>
|
|
|
|
<para><application>Vim</application> has an integrated spell checker
|
|
which you can enable it if you issue the following in a vim window:
|
|
</para>
|
|
|
|
<screen><literal>:setlocal spell spelllang=ru</literal></screen>
|
|
|
|
<para>This setting will enable spell checking for the Russian
|
|
language for the current session.</para>
|
|
|
|
<para>By default, <application>Vim</application> only installs spell
|
|
files for the English language. If a spell file is not available for
|
|
a language, then <application>Vim</application> will call the
|
|
<filename>$VIMRUNTIME/plugin/spellfile.vim</filename> plugin and will try
|
|
to obtain the *.spl and optionally *.sug from the vim ftp server,
|
|
by using the <filename>$VIMRUNTIME/plugin/netrwPlugin.vim</filename>
|
|
plugin.</para>
|
|
|
|
<!-- When updating, be sure to change the line below for the proper 'vimxx' unpacked
|
|
directory -->
|
|
<para>Alternatively you can manually download the *.spl and *.sug files
|
|
from: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/"/> and save
|
|
them to <filename class="directory"> ~/.vim/spell </filename> or in
|
|
<filename class="directory">/usr/share/vim/vim&vim-majmin;/spell/</filename>.</para>
|
|
|
|
<para>To find out what's new in <application>Vim-&vim-version;</application>
|
|
issue the following command:</para>
|
|
|
|
<screen><literal>:help version-&vim-version;</literal></screen>
|
|
|
|
<para>For additional information on setting up
|
|
<application>Vim</application> configuration files, see <xref
|
|
linkend="postlfs-config-vimrc"/> and <ulink
|
|
url='http://vim.wikia.com/wiki/Example_vimrc'/>.</para>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<para>A list of the reinstalled files, along with their short
|
|
descriptions can be found in the <ulink
|
|
url="&lfs-root;/chapter06/vim.html#contents-vim">LFS Vim Installation
|
|
Instructions</ulink></para>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directory</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>gview, gvim, gvimdiff, rgview, and rgvim</seg>
|
|
<seg>None</seg>
|
|
<seg>/usr/share/vim</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="gview">
|
|
<term><command>gview</command></term>
|
|
<listitem>
|
|
<para>starts <command>gvim</command> in read-only mode.</para>
|
|
<indexterm zone="vim gview">
|
|
<primary sortas="b-gview">gview</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="gvim">
|
|
<term><command>gvim</command></term>
|
|
<listitem>
|
|
<para>is the editor that runs under <application>X</application>
|
|
and includes a GUI.</para>
|
|
<indexterm zone="vim gvim">
|
|
<primary sortas="b-gvim">gvim</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="gvimdiff">
|
|
<term><command>gvimdiff</command></term>
|
|
<listitem>
|
|
<para>edits two or three versions of a file with
|
|
<command>gvim</command> and shows the differences.</para>
|
|
<indexterm zone="vim gvimdiff">
|
|
<primary sortas="b-gvimdiff">gvimdiff</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rgview">
|
|
<term><command>rgview</command></term>
|
|
<listitem>
|
|
<para>is a restricted version of <command>gview</command>.</para>
|
|
<indexterm zone="vim rgview">
|
|
<primary sortas="b-rgview">rgview</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rgvim">
|
|
<term><command>rgvim</command></term>
|
|
<listitem>
|
|
<para>is a restricted version of <command>gvim</command>. </para>
|
|
<indexterm zone="vim gvim">
|
|
<primary sortas="b-gvim">gvim</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|