[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-vim" role="wrap">
|
---|
| 9 | <?dbhtml filename="vim.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Vim-&vim-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-system-vim">
|
---|
| 14 | <primary sortas="a-Vim">Vim</primary>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 17 | <sect2 role="package">
|
---|
| 18 | <title/>
|
---|
| 19 |
|
---|
| 20 | <para>The Vim package contains a powerful text editor.</para>
|
---|
| 21 |
|
---|
[44fb8dd] | 22 | </sect2>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="installation">
|
---|
| 25 | <title>Installation of Vim</title>
|
---|
| 26 |
|
---|
| 27 | <tip os="t1">
|
---|
[3f8be484] | 28 | <title>Alternatives to Vim</title>
|
---|
| 29 |
|
---|
| 30 | <para>If you prefer another editor—such as Emacs, Joe, or
|
---|
| 31 | Nano—please refer to <ulink
|
---|
[af24f92] | 32 | url="&cblfs-root;index.php/Category:Text_Editors"/>
|
---|
[3f8be484] | 33 | for suggested installation instructions.</para>
|
---|
| 34 | </tip>
|
---|
| 35 |
|
---|
[52f91b9] | 36 | <para os="p1">The following patch merges all updates from the &vim-version; Branch
|
---|
[2830f42] | 37 | from the Vim developers:</para>
|
---|
[6334994] | 38 |
|
---|
[2830f42] | 39 | <screen os="p2"><userinput>patch -Np1 -i ../&vim-branch_update-patch;</userinput></screen>
|
---|
[6334994] | 40 |
|
---|
| 41 | <para os="b">Change the default location of
|
---|
[3f8be484] | 42 | the <filename>vimrc</filename> configuration file to <filename
|
---|
| 43 | class="directory">/etc</filename>:</para>
|
---|
| 44 |
|
---|
[6334994] | 45 | <screen os="c"><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen>
|
---|
[3f8be484] | 46 |
|
---|
[6334994] | 47 | <para os="d">Prepare Vim for compilation:</para>
|
---|
[3f8be484] | 48 |
|
---|
[6c5a343] | 49 | <screen os="e"><userinput>./configure \
|
---|
[f4a3466] | 50 | --prefix=/usr --enable-multibyte</userinput></screen>
|
---|
[3f8be484] | 51 |
|
---|
[6334994] | 52 | <variablelist os="f">
|
---|
[3f8be484] | 53 | <title>The meaning of the configure options:</title>
|
---|
| 54 |
|
---|
| 55 | <varlistentry>
|
---|
| 56 | <term><parameter>--enable-multibyte</parameter></term>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>This optional but highly recommended switch enables support
|
---|
| 59 | for editing files in multibyte character encodings. This is needed
|
---|
| 60 | if using a locale with a multibyte character set. This switch is
|
---|
| 61 | also helpful to be able to edit text files initially created in
|
---|
[2886713] | 62 | Linux distributions like Fedora that use UTF-8 as a default
|
---|
[3f8be484] | 63 | character set.</para>
|
---|
| 64 | </listitem>
|
---|
| 65 | </varlistentry>
|
---|
| 66 |
|
---|
| 67 | </variablelist>
|
---|
| 68 |
|
---|
[6334994] | 69 | <para os="g">Compile the package:</para>
|
---|
[3f8be484] | 70 |
|
---|
[6334994] | 71 | <screen os="h"><userinput>make</userinput></screen>
|
---|
[3f8be484] | 72 |
|
---|
[686839b] | 73 | <para os="i">To test the results, issue:</para>
|
---|
| 74 |
|
---|
| 75 | <screen os="i2"><userinput remap="test">make test</userinput></screen>
|
---|
| 76 |
|
---|
| 77 | <para os="i3">However, this test suite outputs a lot of binary data to the
|
---|
[3f8be484] | 78 | screen, which can cause issues with the settings of the current terminal.
|
---|
| 79 | This can be resolved by redirecting the output to a log file.</para>
|
---|
| 80 |
|
---|
[6334994] | 81 | <para os="j">Install the package:</para>
|
---|
[3f8be484] | 82 |
|
---|
[6334994] | 83 | <screen os="k"><userinput>make install</userinput></screen>
|
---|
[3f8be484] | 84 |
|
---|
[689b882f] | 85 | <para os="l">Many users are accustomed to using <command>vi</command>
|
---|
| 86 | instead of <command>vim</command>. Some programs, such as
|
---|
| 87 | <command>vigr</command> and <command>vipw</command>, also use
|
---|
| 88 | <command>vi</command>. Create a symlink to permit execution of
|
---|
| 89 | <command>vim</command> when users habitually enter <command>vi</command>
|
---|
| 90 | and allow programs that use <command>vi</command> to work:</para>
|
---|
[3f8be484] | 91 |
|
---|
[94e6142] | 92 | <screen os="m"><userinput>ln -sv vim /usr/bin/vi</userinput></screen>
|
---|
[3f8be484] | 93 |
|
---|
[6334994] | 94 | <para os="n">By default, Vim's documentation is installed in
|
---|
[0d2d688] | 95 | <filename class="directory">/usr/share/vim</filename>. The following symlink
|
---|
| 96 | allows the documentation to be accessed via
|
---|
| 97 | <filename class="directory">/usr/share/doc/vim-&vim-version;</filename>, making
|
---|
| 98 | it consistent with the location of documentation for other packages:</para>
|
---|
| 99 |
|
---|
[6334994] | 100 | <screen os="o"><userinput>ln -sv ../vim/vim&vim-version2;/doc /usr/share/doc/vim-&vim-version;</userinput></screen>
|
---|
[0d2d688] | 101 |
|
---|
[fb40919] | 102 | <para os="p">If an X Window System is going to be installed on the CLFS
|
---|
[a1fb12f] | 103 | system, you may want to recompile Vim after installing X. Vim
|
---|
[3f8be484] | 104 | comes with a GUI version of the editor that requires X and some
|
---|
[a1fb12f] | 105 | additional libraries to be installed. For more information, refer to the
|
---|
[af4f700] | 106 | Vim documentation and the Vim installation page in CBLFS at <ulink
|
---|
[0d4607d] | 107 | url="&cblfs-root;index.php/Vim"/>.</para>
|
---|
[3f8be484] | 108 |
|
---|
| 109 | </sect2>
|
---|
| 110 |
|
---|
| 111 | <sect2 id="conf-vim" role="configuration">
|
---|
| 112 | <title>Configuring Vim</title>
|
---|
| 113 |
|
---|
| 114 | <indexterm zone="conf-vim">
|
---|
[9c127a8] | 115 | <primary sortas="e-/etc/vimrc">/etc/vimrc</primary>
|
---|
[3f8be484] | 116 | </indexterm>
|
---|
| 117 |
|
---|
| 118 | <para>By default, <command>vim</command> runs in vi-incompatible mode.
|
---|
| 119 | This may be new to users who have used other editors in the past. The
|
---|
| 120 | <quote>nocompatible</quote> setting is included below to highlight the
|
---|
| 121 | fact that a new behavior is being used. It also reminds those who would
|
---|
| 122 | change to <quote>compatible</quote> mode that it should be the first
|
---|
| 123 | setting in the configuration file. This is necessary because it changes
|
---|
| 124 | other settings, and overrides must come after this setting. Create a
|
---|
| 125 | default <command>vim</command> configuration file by running the
|
---|
| 126 | following:</para>
|
---|
| 127 |
|
---|
| 128 | <screen><userinput>cat > /etc/vimrc << "EOF"
|
---|
| 129 | <literal>" Begin /etc/vimrc
|
---|
| 130 |
|
---|
| 131 | set nocompatible
|
---|
| 132 | set backspace=2
|
---|
[d6416dd] | 133 | set ruler
|
---|
[3f8be484] | 134 | syntax on
|
---|
| 135 | if (&term == "iterm") || (&term == "putty")
|
---|
| 136 | set background=dark
|
---|
| 137 | endif
|
---|
| 138 |
|
---|
| 139 | " End /etc/vimrc</literal>
|
---|
| 140 | EOF</userinput></screen>
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | <para>The <parameter>set nocompatible</parameter> makes
|
---|
| 144 | <command>vim</command> behave in a more useful way (the default) than
|
---|
| 145 | the vi-compatible manner. Remove the <quote>no</quote> to keep the
|
---|
| 146 | old <command>vi</command> behavior. The <parameter>set
|
---|
| 147 | backspace=2</parameter> allows backspacing over line breaks,
|
---|
| 148 | autoindents, and the start of insert. The <parameter>syntax
|
---|
| 149 | on</parameter> enables vim's syntax highlighting. Finally, the
|
---|
| 150 | <emphasis>if</emphasis> statement with the <parameter>set
|
---|
| 151 | background=dark</parameter> corrects <command>vim</command>'s guess
|
---|
| 152 | about the background color of some terminal emulators. This gives the
|
---|
| 153 | highlighting a better color scheme for use on the black background of
|
---|
| 154 | these programs.</para>
|
---|
| 155 |
|
---|
| 156 | <para>Documentation for other available options can be obtained by
|
---|
| 157 | running the following command:</para>
|
---|
| 158 |
|
---|
[0f3854e] | 159 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen>
|
---|
[3f8be484] | 160 |
|
---|
| 161 | </sect2>
|
---|
| 162 |
|
---|
| 163 | <sect2 id="contents-vim" role="content">
|
---|
| 164 | <title>Contents of Vim</title>
|
---|
| 165 |
|
---|
| 166 | <segmentedlist>
|
---|
| 167 | <segtitle>Installed programs</segtitle>
|
---|
[61ad0b7f] | 168 | <segtitle>Installed directory</segtitle>
|
---|
[3f8be484] | 169 |
|
---|
| 170 | <seglistitem>
|
---|
| 171 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk,
|
---|
| 172 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl,
|
---|
| 173 | tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl,
|
---|
| 174 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg>
|
---|
[61ad0b7f] | 175 | <seg>/usr/share/vim</seg>
|
---|
[3f8be484] | 176 | </seglistitem>
|
---|
| 177 | </segmentedlist>
|
---|
| 178 |
|
---|
| 179 | <variablelist>
|
---|
| 180 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 181 | <?dbfo list-presentation="list"?>
|
---|
| 182 | <?dbhtml list-presentation="table"?>
|
---|
| 183 |
|
---|
| 184 | <varlistentry id="efm_filter.pl">
|
---|
| 185 | <term><command>efm_filter.pl</command></term>
|
---|
| 186 | <listitem>
|
---|
| 187 | <para>A filter for creating an error file that can be read
|
---|
| 188 | by <command>vim</command></para>
|
---|
| 189 | <indexterm zone="ch-system-vim efm_filter.pl">
|
---|
| 190 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary>
|
---|
| 191 | </indexterm>
|
---|
| 192 | </listitem>
|
---|
| 193 | </varlistentry>
|
---|
| 194 |
|
---|
| 195 | <varlistentry id="efm_perl.pl">
|
---|
| 196 | <term><command>efm_perl.pl</command></term>
|
---|
| 197 | <listitem>
|
---|
| 198 | <para>Reformats the error messages of the Perl interpreter for use
|
---|
| 199 | with the <quote>quickfix</quote> mode of <command>vim</command></para>
|
---|
| 200 | <indexterm zone="ch-system-vim efm_perl.pl">
|
---|
| 201 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary>
|
---|
| 202 | </indexterm>
|
---|
| 203 | </listitem>
|
---|
| 204 | </varlistentry>
|
---|
| 205 |
|
---|
| 206 | <varlistentry id="ex">
|
---|
| 207 | <term><command>ex</command></term>
|
---|
| 208 | <listitem>
|
---|
| 209 | <para>Starts <command>vim</command> in ex mode</para>
|
---|
| 210 | <indexterm zone="ch-system-vim ex">
|
---|
| 211 | <primary sortas="b-ex">ex</primary>
|
---|
| 212 | </indexterm>
|
---|
| 213 | </listitem>
|
---|
| 214 | </varlistentry>
|
---|
| 215 |
|
---|
| 216 | <varlistentry id="less.sh">
|
---|
| 217 | <term><command>less.sh</command></term>
|
---|
| 218 | <listitem>
|
---|
| 219 | <para>A script that starts <command>vim</command> with less.vim</para>
|
---|
| 220 | <indexterm zone="ch-system-vim less.sh">
|
---|
| 221 | <primary sortas="b-less.sh">less.sh</primary>
|
---|
| 222 | </indexterm>
|
---|
| 223 | </listitem>
|
---|
| 224 | </varlistentry>
|
---|
| 225 |
|
---|
| 226 | <varlistentry id="mve.awk">
|
---|
| 227 | <term><command>mve.awk</command></term>
|
---|
| 228 | <listitem>
|
---|
| 229 | <para>Processes <command>vim</command> errors</para>
|
---|
| 230 | <indexterm zone="ch-system-vim mve.awk">
|
---|
| 231 | <primary sortas="b-mve.awk">mve.awk</primary>
|
---|
| 232 | </indexterm>
|
---|
| 233 | </listitem>
|
---|
| 234 | </varlistentry>
|
---|
| 235 |
|
---|
| 236 | <varlistentry id="pltags.pl">
|
---|
| 237 | <term><command>pltags.pl</command></term>
|
---|
| 238 | <listitem>
|
---|
| 239 | <para>Creates a tags file for Perl code for use by
|
---|
| 240 | <command>vim</command></para>
|
---|
| 241 | <indexterm zone="ch-system-vim pltags.pl">
|
---|
| 242 | <primary sortas="b-pltags.pl">pltags.pl</primary>
|
---|
| 243 | </indexterm>
|
---|
| 244 | </listitem>
|
---|
| 245 | </varlistentry>
|
---|
| 246 |
|
---|
| 247 | <varlistentry id="ref">
|
---|
| 248 | <term><command>ref</command></term>
|
---|
| 249 | <listitem>
|
---|
| 250 | <para>Checks the spelling of arguments</para>
|
---|
| 251 | <indexterm zone="ch-system-vim ref">
|
---|
| 252 | <primary sortas="b-ref">ref</primary>
|
---|
| 253 | </indexterm>
|
---|
| 254 | </listitem>
|
---|
| 255 | </varlistentry>
|
---|
| 256 |
|
---|
| 257 | <varlistentry id="rview">
|
---|
| 258 | <term><command>rview</command></term>
|
---|
| 259 | <listitem>
|
---|
| 260 | <para>Is a restricted version of <command>view</command>; no shell
|
---|
| 261 | commands can be started and <command>view</command> cannot be
|
---|
| 262 | suspended</para>
|
---|
| 263 | <indexterm zone="ch-system-vim rview">
|
---|
| 264 | <primary sortas="b-rview">rview</primary>
|
---|
| 265 | </indexterm>
|
---|
| 266 | </listitem>
|
---|
| 267 | </varlistentry>
|
---|
| 268 |
|
---|
| 269 | <varlistentry id="rvim">
|
---|
| 270 | <term><command>rvim</command></term>
|
---|
| 271 | <listitem>
|
---|
| 272 | <para>Is a restricted version of <command>vim</command>; no shell
|
---|
| 273 | commands can be started and <command>vim</command> cannot be
|
---|
| 274 | suspended</para>
|
---|
| 275 | <indexterm zone="ch-system-vim rvim">
|
---|
| 276 | <primary sortas="b-rvim">rvim</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
| 280 |
|
---|
| 281 | <varlistentry id="shtags.pl">
|
---|
| 282 | <term><command>shtags.pl</command></term>
|
---|
| 283 | <listitem>
|
---|
| 284 | <para>Generates a tags file for Perl scripts</para>
|
---|
| 285 | <indexterm zone="ch-system-vim shtags.pl">
|
---|
| 286 | <primary sortas="b-shtags.pl">shtags.pl</primary>
|
---|
| 287 | </indexterm>
|
---|
| 288 | </listitem>
|
---|
| 289 | </varlistentry>
|
---|
| 290 |
|
---|
| 291 | <varlistentry id="tcltags">
|
---|
| 292 | <term><command>tcltags</command></term>
|
---|
| 293 | <listitem>
|
---|
| 294 | <para>Generates a tags file for TCL code</para>
|
---|
| 295 | <indexterm zone="ch-system-vim tcltags">
|
---|
| 296 | <primary sortas="b-tcltags">tcltags</primary>
|
---|
| 297 | </indexterm>
|
---|
| 298 | </listitem>
|
---|
| 299 | </varlistentry>
|
---|
| 300 |
|
---|
| 301 | <varlistentry id="view">
|
---|
| 302 | <term><command>view</command></term>
|
---|
| 303 | <listitem>
|
---|
| 304 | <para>Starts <command>vim</command> in read-only mode</para>
|
---|
| 305 | <indexterm zone="ch-system-vim view">
|
---|
| 306 | <primary sortas="b-view">view</primary>
|
---|
| 307 | </indexterm>
|
---|
| 308 | </listitem>
|
---|
| 309 | </varlistentry>
|
---|
| 310 |
|
---|
| 311 | <varlistentry id="vi">
|
---|
| 312 | <term><command>vi</command></term>
|
---|
| 313 | <listitem>
|
---|
| 314 | <para>Link to <command>vim</command></para>
|
---|
| 315 | <indexterm zone="ch-system-vim vi">
|
---|
| 316 | <primary sortas="b-vi">vi</primary>
|
---|
| 317 | </indexterm>
|
---|
| 318 | </listitem>
|
---|
| 319 | </varlistentry>
|
---|
| 320 |
|
---|
| 321 | <varlistentry id="vim">
|
---|
| 322 | <term><command>vim</command></term>
|
---|
| 323 | <listitem>
|
---|
| 324 | <para>Is the editor</para>
|
---|
| 325 | <indexterm zone="ch-system-vim vim">
|
---|
| 326 | <primary sortas="b-vim">vim</primary>
|
---|
| 327 | </indexterm>
|
---|
| 328 | </listitem>
|
---|
| 329 | </varlistentry>
|
---|
| 330 |
|
---|
| 331 | <varlistentry id="vim132">
|
---|
| 332 | <term><command>vim132</command></term>
|
---|
| 333 | <listitem>
|
---|
| 334 | <para>Starts <command>vim</command> with the terminal in 132-column
|
---|
| 335 | mode</para>
|
---|
| 336 | <indexterm zone="ch-system-vim vim132">
|
---|
| 337 | <primary sortas="b-vim132">vim132</primary>
|
---|
| 338 | </indexterm>
|
---|
| 339 | </listitem>
|
---|
| 340 | </varlistentry>
|
---|
| 341 |
|
---|
| 342 | <varlistentry id="vim2html.pl">
|
---|
| 343 | <term><command>vim2html.pl</command></term>
|
---|
| 344 | <listitem>
|
---|
| 345 | <para>Converts Vim documentation to HypterText Markup Language
|
---|
| 346 | (HTML)</para>
|
---|
| 347 | <indexterm zone="ch-system-vim vim2html.pl">
|
---|
| 348 | <primary sortas="b-vim2html.pl">vim2html.pl</primary>
|
---|
| 349 | </indexterm>
|
---|
| 350 | </listitem>
|
---|
| 351 | </varlistentry>
|
---|
| 352 |
|
---|
| 353 | <varlistentry id="vimdiff">
|
---|
| 354 | <term><command>vimdiff</command></term>
|
---|
| 355 | <listitem>
|
---|
| 356 | <para>Edits two or three versions of a file with <command>vim</command>
|
---|
| 357 | and show differences</para>
|
---|
| 358 | <indexterm zone="ch-system-vim vimdiff">
|
---|
| 359 | <primary sortas="b-vimdiff">vimdiff</primary>
|
---|
| 360 | </indexterm>
|
---|
| 361 | </listitem>
|
---|
| 362 | </varlistentry>
|
---|
| 363 |
|
---|
| 364 | <varlistentry id="vimm">
|
---|
| 365 | <term><command>vimm</command></term>
|
---|
| 366 | <listitem>
|
---|
| 367 | <para>Enables the DEC locator input model on a remote terminal</para>
|
---|
| 368 | <indexterm zone="ch-system-vim vimm">
|
---|
| 369 | <primary sortas="b-vimm">vimm</primary>
|
---|
| 370 | </indexterm>
|
---|
| 371 | </listitem>
|
---|
| 372 | </varlistentry>
|
---|
| 373 |
|
---|
| 374 | <varlistentry id="vimspell.sh">
|
---|
| 375 | <term><command>vimspell.sh</command></term>
|
---|
| 376 | <listitem>
|
---|
| 377 | <para>Spell checks a file and generates the syntax statements
|
---|
| 378 | necessary to highlight in <command>vim</command>. This script
|
---|
| 379 | requires the old Unix <command>spell</command> command, which
|
---|
[0d4607d] | 380 | is provided neither in CLFS nor in CBLFS</para>
|
---|
[3f8be484] | 381 | <indexterm zone="ch-system-vim vimspell.sh">
|
---|
| 382 | <primary sortas="b-vimspell.sh">vimspell.sh</primary>
|
---|
| 383 | </indexterm>
|
---|
| 384 | </listitem>
|
---|
| 385 | </varlistentry>
|
---|
| 386 |
|
---|
| 387 | <varlistentry id="vimtutor">
|
---|
| 388 | <term><command>vimtutor</command></term>
|
---|
| 389 | <listitem>
|
---|
| 390 | <para>Teaches the basic keys and commands of
|
---|
| 391 | <command>vim</command></para>
|
---|
| 392 | <indexterm zone="ch-system-vim vimtutor">
|
---|
| 393 | <primary sortas="b-vimtutor">vimtutor</primary>
|
---|
| 394 | </indexterm>
|
---|
| 395 | </listitem>
|
---|
| 396 | </varlistentry>
|
---|
| 397 |
|
---|
| 398 | <varlistentry id="xxd">
|
---|
| 399 | <term><command>xxd</command></term>
|
---|
| 400 | <listitem>
|
---|
| 401 | <para>Creates a hex dump of the given file; it can
|
---|
| 402 | also do the reverse, so it can be used for binary patching</para>
|
---|
| 403 | <indexterm zone="ch-system-vim xxd">
|
---|
| 404 | <primary sortas="b-xxd">xxd</primary>
|
---|
| 405 | </indexterm>
|
---|
| 406 | </listitem>
|
---|
| 407 | </varlistentry>
|
---|
| 408 |
|
---|
| 409 | </variablelist>
|
---|
| 410 |
|
---|
| 411 | </sect2>
|
---|
| 412 |
|
---|
| 413 | </sect1>
|
---|