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