[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[1770019] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[673b0d8] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
[3e36a78] | 4 | <!ENTITY % patches-entities SYSTEM "../patches.ent">
|
---|
[673b0d8] | 5 | %general-entities;
|
---|
[3e36a78] | 6 | %patches-entities;
|
---|
[673b0d8] | 7 | ]>
|
---|
[81fd230] | 8 | <sect1 id="ch-system-vim" role="wrap">
|
---|
[673b0d8] | 9 | <title>Vim-&vim-version;</title>
|
---|
| 10 | <?dbhtml filename="vim.html"?>
|
---|
| 11 |
|
---|
| 12 | <indexterm zone="ch-system-vim"><primary sortas="a-Vim">Vim</primary></indexterm>
|
---|
[6370fa6] | 13 |
|
---|
[a001133] | 14 | <sect2 role="package"><title/>
|
---|
[81fd230] | 15 | <para>The Vim package contains a powerful text editor.</para>
|
---|
[5888299] | 16 |
|
---|
[a001133] | 17 | <segmentedlist>
|
---|
| 18 | <segtitle>&buildtime;</segtitle>
|
---|
| 19 | <segtitle>&diskspace;</segtitle>
|
---|
[eb6d9eb] | 20 | <seglistitem><seg>0.4 SBU</seg><seg>38.0 MB</seg></seglistitem>
|
---|
[a001133] | 21 | </segmentedlist>
|
---|
| 22 |
|
---|
[81fd230] | 23 | <segmentedlist>
|
---|
[45992ae] | 24 | <segtitle>&dependencies;</segtitle>
|
---|
[81fd230] | 25 | <seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
|
---|
| 26 | GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem>
|
---|
| 27 | </segmentedlist>
|
---|
| 28 |
|
---|
| 29 | <tip>
|
---|
| 30 | <title>Alternatives to Vim</title>
|
---|
| 31 | <para>If you prefer another editor—such as Emacs, Joe, or
|
---|
| 32 | Nano—please refer to <ulink url="&blfs-root;view/svn/postlfs/editors.html"/>
|
---|
| 33 | for suggested installation instructions.</para>
|
---|
| 34 | </tip>
|
---|
[35c2fa60] | 35 | </sect2>
|
---|
| 36 |
|
---|
[a001133] | 37 | <sect2 role="installation">
|
---|
[73aedd1d] | 38 | <title>Installation of Vim</title>
|
---|
| 39 |
|
---|
[81fd230] | 40 | <para>First, unpack both
|
---|
| 41 | <filename>vim-&vim-version;.tar.bz2</filename> and (optionally)
|
---|
| 42 | <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the
|
---|
[62c3dff] | 43 | same directory. Then, change the default location of the
|
---|
[f7ea35e] | 44 | <filename>vimrc</filename> configuration file to <filename
|
---|
[81fd230] | 45 | class="directory">/etc</filename>:</para>
|
---|
[73aedd1d] | 46 |
|
---|
[15966d9] | 47 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen>
|
---|
[008a51d] | 48 |
|
---|
[73aedd1d] | 49 | <para>Now prepare Vim for compilation:</para>
|
---|
| 50 |
|
---|
[c3d6ceb] | 51 | <screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen>
|
---|
[73aedd1d] | 52 |
|
---|
[06948c1] | 53 | <para>The meaning of the configure options:</para>
|
---|
| 54 |
|
---|
| 55 | <variablelist>
|
---|
| 56 | <varlistentry>
|
---|
| 57 | <term><parameter>--enable-multibyte</parameter></term>
|
---|
| 58 | <listitem><para>This optional but highly recommended switch enables support for
|
---|
| 59 | editing files in multibyte character encodings. This is needed if using a
|
---|
| 60 | locale with a multibyte character set. This switch is also helpful to be able to
|
---|
| 61 | edit text files initially created in Linux distributions like Fedora Core that
|
---|
| 62 | use UTF-8 as a default character set.</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </varlistentry>
|
---|
| 65 | </variablelist>
|
---|
[81fd230] | 66 |
|
---|
[73aedd1d] | 67 | <para>Compile the package:</para>
|
---|
| 68 |
|
---|
| 69 | <screen><userinput>make</userinput></screen>
|
---|
| 70 |
|
---|
[e5846ef] | 71 | <para>To test the results, issue: <userinput>make test</userinput>. However,
|
---|
| 72 | this test suite outputs a lot of binary data to the screen, which can cause
|
---|
| 73 | issues with the settings of the current terminal. This can be resolved by
|
---|
| 74 | redirecting the output to a log file.</para>
|
---|
[1a73ed4] | 75 |
|
---|
[81fd230] | 76 | <para>Install the package:</para>
|
---|
[73aedd1d] | 77 |
|
---|
| 78 | <screen><userinput>make install</userinput></screen>
|
---|
| 79 |
|
---|
[81fd230] | 80 | <para>Many users are used to using <command>vi</command> instead of
|
---|
| 81 | <command>vim</command>. To allow execution of <command>vim</command>
|
---|
| 82 | when users habitually enter <command>vi</command>, create a
|
---|
| 83 | symlink:</para>
|
---|
[73aedd1d] | 84 |
|
---|
[5998892] | 85 | <screen><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
|
---|
[73aedd1d] | 86 |
|
---|
[bc2136e] | 87 | <para>If an X Window System is going to be installed on the LFS
|
---|
[81fd230] | 88 | system, it may be necessary to recompile Vim after installing X. Vim
|
---|
| 89 | comes with a GUI version of the editor that requires X and some
|
---|
| 90 | additional libraries to be installed. For more information on this
|
---|
| 91 | process, refer to the Vim documentation and the Vim installation page
|
---|
| 92 | in the BLFS book at <ulink
|
---|
| 93 | url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para>
|
---|
[0ba2766b] | 94 |
|
---|
[81fd230] | 95 | </sect2>
|
---|
[342b176] | 96 |
|
---|
[df8334f] | 97 | <sect2 id="conf-vim" role="configuration"><title>Configuring Vim</title>
|
---|
[81fd230] | 98 | <indexterm zone="conf-vim"><primary sortas="e-/etc/vim">/etc/vim</primary></indexterm>
|
---|
[3f0c882] | 99 |
|
---|
[e5846ef] | 100 | <para>By default, <command>vim</command> runs in vi-incompatible mode. This may
|
---|
| 101 | be new to users who have used other editors in the past. The
|
---|
| 102 | <quote>nocompatible</quote> setting is included below to highlight the fact that
|
---|
| 103 | a new behavior is being used. It also reminds those who would change to
|
---|
| 104 | <quote>compatible</quote> mode that it should be the first setting in the
|
---|
| 105 | configuration file. This is necessary because it changes other settings, and
|
---|
| 106 | overrides must come after this setting. Create a default <command>vim</command>
|
---|
[81fd230] | 107 | configuration file by running the following:</para>
|
---|
[342b176] | 108 |
|
---|
[8ad7980] | 109 | <screen><userinput>cat > /etc/vimrc << "EOF"
|
---|
[d72e04a] | 110 | <literal>" Begin /etc/vimrc
|
---|
[342b176] | 111 |
|
---|
| 112 | set nocompatible
|
---|
| 113 | set backspace=2
|
---|
| 114 | syntax on
|
---|
[3e05705] | 115 | if (&term == "iterm") || (&term == "putty")
|
---|
| 116 | set background=dark
|
---|
| 117 | endif
|
---|
[342b176] | 118 |
|
---|
[d72e04a] | 119 | " End /etc/vimrc</literal>
|
---|
[8ad7980] | 120 | EOF</userinput></screen>
|
---|
[342b176] | 121 |
|
---|
[81fd230] | 122 | <para>The <parameter>set nocompatible</parameter> makes
|
---|
| 123 | <command>vim</command> behave in a more useful way (the default) than
|
---|
[f7ea35e] | 124 | the vi-compatible manner. Remove the <quote>no</quote> to keep the
|
---|
[81fd230] | 125 | old <command>vi</command> behavior. The <parameter>set
|
---|
| 126 | backspace=2</parameter> allows backspacing over line breaks,
|
---|
| 127 | autoindents, and the start of insert. The <parameter>syntax
|
---|
| 128 | on</parameter> enables vim's syntax highlighting. Finally, the
|
---|
| 129 | <emphasis>if</emphasis> statement with the <parameter>set
|
---|
| 130 | background=dark</parameter> corrects <command>vim</command>'s guess
|
---|
| 131 | about the background color of some terminal emulators. This gives the
|
---|
| 132 | highlighting a better color scheme for use on the black background of
|
---|
| 133 | these programs.</para>
|
---|
| 134 |
|
---|
| 135 | <para>Documentation for other available options can be obtained by
|
---|
| 136 | running the following command:</para>
|
---|
[dc32fef] | 137 |
|
---|
[de92788] | 138 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
|
---|
[dc32fef] | 139 |
|
---|
[342b176] | 140 | </sect2>
|
---|
[0ba2766b] | 141 |
|
---|
[c6cb3aa] | 142 | <sect2 id="contents-vim" role="content"><title>Contents of Vim</title>
|
---|
[673b0d8] | 143 |
|
---|
[81fd230] | 144 | <segmentedlist>
|
---|
| 145 | <segtitle>Installed programs</segtitle>
|
---|
[f7ea35e] | 146 | <seglistitem><seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
| 147 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim),
|
---|
| 148 | view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh,
|
---|
[81fd230] | 149 | vimtutor, and xxd</seg></seglistitem>
|
---|
| 150 | </segmentedlist>
|
---|
| 151 |
|
---|
| 152 | <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 153 | <?dbfo list-presentation="list"?>
|
---|
[8f97096] | 154 | <?dbhtml list-presentation="table"?>
|
---|
[81fd230] | 155 |
|
---|
| 156 | <varlistentry id="efm_filter.pl">
|
---|
| 157 | <term><command>efm_filter.pl</command></term>
|
---|
| 158 | <listitem>
|
---|
| 159 | <para>A filter for creating an error file that can be read by <command>vim</command></para>
|
---|
| 160 | <indexterm zone="ch-system-vim efm_filter.pl"><primary sortas="b-efm_filter.pl">efm_filter.pl</primary></indexterm>
|
---|
| 161 | </listitem>
|
---|
| 162 | </varlistentry>
|
---|
| 163 |
|
---|
| 164 | <varlistentry id="efm_perl.pl">
|
---|
| 165 | <term><command>efm_perl.pl</command></term>
|
---|
| 166 | <listitem>
|
---|
| 167 | <para>Reformats the error messages of the
|
---|
| 168 | Perl interpreter for use with the <quote>quickfix</quote> mode of <command>vim</command></para>
|
---|
| 169 | <indexterm zone="ch-system-vim efm_perl.pl"><primary sortas="b-efm_perl.pl">efm_perl.pl</primary></indexterm>
|
---|
| 170 | </listitem>
|
---|
| 171 | </varlistentry>
|
---|
| 172 |
|
---|
| 173 | <varlistentry id="ex">
|
---|
| 174 | <term><command>ex</command></term>
|
---|
| 175 | <listitem>
|
---|
| 176 | <para>Starts <command>vim</command> in ex mode</para>
|
---|
| 177 | <indexterm zone="ch-system-vim ex"><primary sortas="b-ex">ex</primary></indexterm>
|
---|
| 178 | </listitem>
|
---|
| 179 | </varlistentry>
|
---|
| 180 |
|
---|
| 181 | <varlistentry id="less.sh">
|
---|
| 182 | <term><command>less.sh</command></term>
|
---|
| 183 | <listitem>
|
---|
| 184 | <para>A script that starts <command>vim</command> with less.vim</para>
|
---|
| 185 | <indexterm zone="ch-system-vim less.sh"><primary sortas="b-less.sh">less.sh</primary></indexterm>
|
---|
| 186 | </listitem>
|
---|
| 187 | </varlistentry>
|
---|
| 188 |
|
---|
| 189 | <varlistentry id="mve.awk">
|
---|
| 190 | <term><command>mve.awk</command></term>
|
---|
| 191 | <listitem>
|
---|
| 192 | <para>Processes <command>vim</command> errors</para>
|
---|
| 193 | <indexterm zone="ch-system-vim mve.awk"><primary sortas="b-mve.awk">mve.awk</primary></indexterm>
|
---|
| 194 | </listitem>
|
---|
| 195 | </varlistentry>
|
---|
| 196 |
|
---|
| 197 | <varlistentry id="pltags.pl">
|
---|
| 198 | <term><command>pltags.pl</command></term>
|
---|
| 199 | <listitem>
|
---|
| 200 | <para>Creates a tags file for Perl code for use by <command>vim</command></para>
|
---|
| 201 | <indexterm zone="ch-system-vim pltags.pl"><primary sortas="b-pltags.pl">pltags.pl</primary></indexterm>
|
---|
| 202 | </listitem>
|
---|
| 203 | </varlistentry>
|
---|
| 204 |
|
---|
| 205 | <varlistentry id="ref">
|
---|
| 206 | <term><command>ref</command></term>
|
---|
| 207 | <listitem>
|
---|
| 208 | <para>Checks the spelling of arguments</para>
|
---|
| 209 | <indexterm zone="ch-system-vim ref"><primary sortas="b-ref">ref</primary></indexterm>
|
---|
| 210 | </listitem>
|
---|
| 211 | </varlistentry>
|
---|
| 212 |
|
---|
| 213 | <varlistentry id="rview">
|
---|
| 214 | <term><command>rview</command></term>
|
---|
| 215 | <listitem>
|
---|
| 216 | <para>Is a restricted version of <command>view</command>; no shell
|
---|
| 217 | commands can be started and <command>view</command> cannot be suspended</para>
|
---|
| 218 | <indexterm zone="ch-system-vim rview"><primary sortas="b-rview">rview</primary></indexterm>
|
---|
| 219 | </listitem>
|
---|
| 220 | </varlistentry>
|
---|
| 221 |
|
---|
| 222 | <varlistentry id="rvim">
|
---|
| 223 | <term><command>rvim</command></term>
|
---|
| 224 | <listitem>
|
---|
| 225 | <para>Is a restricted version of <command>vim</command>; no shell
|
---|
| 226 | commands can be started and <command>vim</command> cannot be suspended</para>
|
---|
| 227 | <indexterm zone="ch-system-vim rvim"><primary sortas="b-rvim">rvim</primary></indexterm>
|
---|
| 228 | </listitem>
|
---|
| 229 | </varlistentry>
|
---|
| 230 |
|
---|
| 231 | <varlistentry id="shtags.pl">
|
---|
| 232 | <term><command>shtags.pl</command></term>
|
---|
| 233 | <listitem>
|
---|
[e5846ef] | 234 | <para>Generates a tags file for Perl scripts</para>
|
---|
[81fd230] | 235 | <indexterm zone="ch-system-vim shtags.pl"><primary sortas="b-shtags.pl">shtags.pl</primary></indexterm>
|
---|
| 236 | </listitem>
|
---|
| 237 | </varlistentry>
|
---|
| 238 |
|
---|
| 239 | <varlistentry id="tcltags">
|
---|
| 240 | <term><command>tcltags</command></term>
|
---|
| 241 | <listitem>
|
---|
[e5846ef] | 242 | <para>Generates a tags file for TCL code</para>
|
---|
[81fd230] | 243 | <indexterm zone="ch-system-vim tcltags"><primary sortas="b-tcltags">tcltags</primary></indexterm>
|
---|
| 244 | </listitem>
|
---|
| 245 | </varlistentry>
|
---|
| 246 |
|
---|
| 247 | <varlistentry id="view">
|
---|
| 248 | <term><command>view</command></term>
|
---|
| 249 | <listitem>
|
---|
| 250 | <para>Starts <command>vim</command> in read-only mode</para>
|
---|
| 251 | <indexterm zone="ch-system-vim view"><primary sortas="b-view">view</primary></indexterm>
|
---|
| 252 | </listitem>
|
---|
| 253 | </varlistentry>
|
---|
| 254 |
|
---|
| 255 | <varlistentry id="vi">
|
---|
| 256 | <term><command>vi</command></term>
|
---|
| 257 | <listitem>
|
---|
| 258 | <para>Is the editor</para>
|
---|
| 259 | <indexterm zone="ch-system-vim vi"><primary sortas="b-vi">vi</primary></indexterm>
|
---|
| 260 | </listitem>
|
---|
| 261 | </varlistentry>
|
---|
| 262 |
|
---|
| 263 | <varlistentry id="vim">
|
---|
| 264 | <term><command>vim</command></term>
|
---|
| 265 | <listitem>
|
---|
| 266 | <para>Is the editor</para>
|
---|
| 267 | <indexterm zone="ch-system-vim vim"><primary sortas="b-vim">vim</primary></indexterm>
|
---|
| 268 | </listitem>
|
---|
| 269 | </varlistentry>
|
---|
| 270 |
|
---|
| 271 | <varlistentry id="vim132">
|
---|
| 272 | <term><command>vim132</command></term>
|
---|
| 273 | <listitem>
|
---|
| 274 | <para>Starts <command>vim</command> with the terminal in 132-column mode</para>
|
---|
| 275 | <indexterm zone="ch-system-vim vim132"><primary sortas="b-vim132">vim132</primary></indexterm>
|
---|
| 276 | </listitem>
|
---|
| 277 | </varlistentry>
|
---|
| 278 |
|
---|
| 279 | <varlistentry id="vim2html.pl">
|
---|
| 280 | <term><command>vim2html.pl</command></term>
|
---|
| 281 | <listitem>
|
---|
| 282 | <para>Converts Vim documentation to HypterText Markup Language (HTML)</para>
|
---|
| 283 | <indexterm zone="ch-system-vim vim2html.pl"><primary sortas="b-vim2html.pl">vim2html.pl</primary></indexterm>
|
---|
| 284 | </listitem>
|
---|
| 285 | </varlistentry>
|
---|
| 286 |
|
---|
| 287 | <varlistentry id="vimdiff">
|
---|
| 288 | <term><command>vimdiff</command></term>
|
---|
| 289 | <listitem>
|
---|
| 290 | <para>Edits two or three versions of a file with <command>vim</command> and show differences</para>
|
---|
| 291 | <indexterm zone="ch-system-vim vimdiff"><primary sortas="b-vimdiff">vimdiff</primary></indexterm>
|
---|
| 292 | </listitem>
|
---|
| 293 | </varlistentry>
|
---|
| 294 |
|
---|
| 295 | <varlistentry id="vimm">
|
---|
| 296 | <term><command>vimm</command></term>
|
---|
| 297 | <listitem>
|
---|
| 298 | <para>Enables the DEC locator input model on a remote terminal</para>
|
---|
| 299 | <indexterm zone="ch-system-vim vimm"><primary sortas="b-vimm">vimm</primary></indexterm>
|
---|
| 300 | </listitem>
|
---|
| 301 | </varlistentry>
|
---|
| 302 |
|
---|
| 303 | <varlistentry id="vimspell.sh">
|
---|
| 304 | <term><command>vimspell.sh</command></term>
|
---|
| 305 | <listitem>
|
---|
[e5846ef] | 306 | <para>Spell checks a file and generates the syntax statements necessary to
|
---|
| 307 | highlight in <command>vim</command>. This script requires the old Unix
|
---|
| 308 | <command>spell</command> command, which is provided neither in LFS nor in
|
---|
| 309 | BLFS</para>
|
---|
[81fd230] | 310 | <indexterm zone="ch-system-vim vimspell.sh"><primary sortas="b-vimspell.sh">vimspell.sh</primary></indexterm>
|
---|
| 311 | </listitem>
|
---|
| 312 | </varlistentry>
|
---|
| 313 |
|
---|
| 314 | <varlistentry id="vimtutor">
|
---|
| 315 | <term><command>vimtutor</command></term>
|
---|
| 316 | <listitem>
|
---|
| 317 | <para>Teaches the basic keys and commands of <command>vim</command></para>
|
---|
| 318 | <indexterm zone="ch-system-vim vimtutor"><primary sortas="b-vimtutor">vimtutor</primary></indexterm>
|
---|
| 319 | </listitem>
|
---|
| 320 | </varlistentry>
|
---|
| 321 |
|
---|
| 322 | <varlistentry id="xxd">
|
---|
| 323 | <term><command>xxd</command></term>
|
---|
| 324 | <listitem>
|
---|
| 325 | <para>Creates a hex dump of the given file; it can
|
---|
| 326 | also do the reverse, so it can be used for binary patching</para>
|
---|
| 327 | <indexterm zone="ch-system-vim xxd"><primary sortas="b-xxd">xxd</primary></indexterm>
|
---|
| 328 | </listitem>
|
---|
| 329 | </varlistentry>
|
---|
| 330 | </variablelist>
|
---|
[673b0d8] | 331 |
|
---|
| 332 | </sect2>
|
---|
| 333 |
|
---|
| 334 | </sect1>
|
---|
[81fd230] | 335 |
|
---|