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