[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 | <para os="g">Compile the package:</para> |
---|
[3f8be484] | 53 | |
---|
[6334994] | 54 | <screen os="h"><userinput>make</userinput></screen> |
---|
[3f8be484] | 55 | |
---|
[686839b] | 56 | <para os="i">To test the results, issue:</para> |
---|
| 57 | |
---|
| 58 | <screen os="i2"><userinput remap="test">make test</userinput></screen> |
---|
| 59 | |
---|
| 60 | <para os="i3">However, this test suite outputs a lot of binary data to the |
---|
[3f8be484] | 61 | screen, which can cause issues with the settings of the current terminal. |
---|
| 62 | This can be resolved by redirecting the output to a log file.</para> |
---|
| 63 | |
---|
[6334994] | 64 | <para os="j">Install the package:</para> |
---|
[3f8be484] | 65 | |
---|
[906f724] | 66 | <screen os="k"><userinput>make HELPSUBLOC=/usr/share/doc/vim-&vim-version; install</userinput></screen> |
---|
[3f8be484] | 67 | |
---|
[d1d0c9d] | 68 | <variablelist os="l"> |
---|
| 69 | <title>The meaning of the make option:</title> |
---|
| 70 | |
---|
| 71 | <varlistentry> |
---|
| 72 | <term><parameter>HELPSUBLOC=/usr/share/doc/vim-&vim-version;</parameter></term> |
---|
| 73 | <listitem> |
---|
| 74 | <para>Tells Vim to install its documentation into |
---|
| 75 | <filename class="directory">/usr/share/doc/vim-&vim-version;</filename> |
---|
| 76 | instead of |
---|
| 77 | <filename class="directory">/usr/share/vim/vim&vim-version2;/doc</filename>.</para> |
---|
| 78 | </listitem> |
---|
| 79 | </varlistentry> |
---|
| 80 | |
---|
| 81 | </variablelist> |
---|
| 82 | |
---|
| 83 | <para os="m">Many users are accustomed to using <command>vi</command> |
---|
[689b882f] | 84 | instead of <command>vim</command>. Some programs, such as |
---|
| 85 | <command>vigr</command> and <command>vipw</command>, also use |
---|
| 86 | <command>vi</command>. Create a symlink to permit execution of |
---|
| 87 | <command>vim</command> when users habitually enter <command>vi</command> |
---|
| 88 | and allow programs that use <command>vi</command> to work:</para> |
---|
[3f8be484] | 89 | |
---|
[d1d0c9d] | 90 | <screen os="n"><userinput>ln -sv vim /usr/bin/vi</userinput></screen> |
---|
[3f8be484] | 91 | |
---|
[d1d0c9d] | 92 | <para os="o">If an X Window System is going to be installed on the CLFS |
---|
[a1fb12f] | 93 | system, you may want to recompile Vim after installing X. Vim |
---|
[3f8be484] | 94 | comes with a GUI version of the editor that requires X and some |
---|
[a1fb12f] | 95 | additional libraries to be installed. For more information, refer to the |
---|
[af4f700] | 96 | Vim documentation and the Vim installation page in CBLFS at <ulink |
---|
[0d4607d] | 97 | url="&cblfs-root;index.php/Vim"/>.</para> |
---|
[3f8be484] | 98 | |
---|
| 99 | </sect2> |
---|
| 100 | |
---|
| 101 | <sect2 id="conf-vim" role="configuration"> |
---|
| 102 | <title>Configuring Vim</title> |
---|
| 103 | |
---|
| 104 | <indexterm zone="conf-vim"> |
---|
[9c127a8] | 105 | <primary sortas="e-/etc/vimrc">/etc/vimrc</primary> |
---|
[3f8be484] | 106 | </indexterm> |
---|
| 107 | |
---|
| 108 | <para>By default, <command>vim</command> runs in vi-incompatible mode. |
---|
| 109 | This may be new to users who have used other editors in the past. The |
---|
| 110 | <quote>nocompatible</quote> setting is included below to highlight the |
---|
| 111 | fact that a new behavior is being used. It also reminds those who would |
---|
| 112 | change to <quote>compatible</quote> mode that it should be the first |
---|
| 113 | setting in the configuration file. This is necessary because it changes |
---|
| 114 | other settings, and overrides must come after this setting. Create a |
---|
| 115 | default <command>vim</command> configuration file by running the |
---|
| 116 | following:</para> |
---|
| 117 | |
---|
| 118 | <screen><userinput>cat > /etc/vimrc << "EOF" |
---|
| 119 | <literal>" Begin /etc/vimrc |
---|
| 120 | |
---|
| 121 | set nocompatible |
---|
| 122 | set backspace=2 |
---|
[d6416dd] | 123 | set ruler |
---|
[3f8be484] | 124 | syntax on |
---|
| 125 | if (&term == "iterm") || (&term == "putty") |
---|
| 126 | set background=dark |
---|
| 127 | endif |
---|
| 128 | |
---|
| 129 | " End /etc/vimrc</literal> |
---|
| 130 | EOF</userinput></screen> |
---|
| 131 | |
---|
| 132 | |
---|
| 133 | <para>The <parameter>set nocompatible</parameter> makes |
---|
| 134 | <command>vim</command> behave in a more useful way (the default) than |
---|
| 135 | the vi-compatible manner. Remove the <quote>no</quote> to keep the |
---|
| 136 | old <command>vi</command> behavior. The <parameter>set |
---|
| 137 | backspace=2</parameter> allows backspacing over line breaks, |
---|
| 138 | autoindents, and the start of insert. The <parameter>syntax |
---|
| 139 | on</parameter> enables vim's syntax highlighting. Finally, the |
---|
| 140 | <emphasis>if</emphasis> statement with the <parameter>set |
---|
| 141 | background=dark</parameter> corrects <command>vim</command>'s guess |
---|
| 142 | about the background color of some terminal emulators. This gives the |
---|
| 143 | highlighting a better color scheme for use on the black background of |
---|
| 144 | these programs.</para> |
---|
| 145 | |
---|
| 146 | <para>Documentation for other available options can be obtained by |
---|
| 147 | running the following command:</para> |
---|
| 148 | |
---|
[0f3854e] | 149 | <screen role="nodump"><userinput>vim -c ':options'</userinput></screen> |
---|
[3f8be484] | 150 | |
---|
| 151 | </sect2> |
---|
| 152 | |
---|
| 153 | <sect2 id="contents-vim" role="content"> |
---|
| 154 | <title>Contents of Vim</title> |
---|
| 155 | |
---|
| 156 | <segmentedlist> |
---|
| 157 | <segtitle>Installed programs</segtitle> |
---|
[906f724] | 158 | <segtitle>Installed directories</segtitle> |
---|
[3f8be484] | 159 | |
---|
| 160 | <seglistitem> |
---|
| 161 | <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, |
---|
| 162 | pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, |
---|
| 163 | tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, |
---|
[c2102b28] | 164 | vimdiff (link to vim), vimm, vimspell.sh, vimtutor, xxd</seg> |
---|
[906f724] | 165 | <seg>/usr/share/vim, /usr/share/doc/vim-&vim-version;</seg> |
---|
[3f8be484] | 166 | </seglistitem> |
---|
| 167 | </segmentedlist> |
---|
| 168 | |
---|
| 169 | <variablelist> |
---|
| 170 | <bridgehead renderas="sect3">Short Descriptions</bridgehead> |
---|
| 171 | <?dbfo list-presentation="list"?> |
---|
| 172 | <?dbhtml list-presentation="table"?> |
---|
| 173 | |
---|
| 174 | <varlistentry id="efm_filter.pl"> |
---|
| 175 | <term><command>efm_filter.pl</command></term> |
---|
| 176 | <listitem> |
---|
| 177 | <para>A filter for creating an error file that can be read |
---|
| 178 | by <command>vim</command></para> |
---|
| 179 | <indexterm zone="ch-system-vim efm_filter.pl"> |
---|
| 180 | <primary sortas="b-efm_filter.pl">efm_filter.pl</primary> |
---|
| 181 | </indexterm> |
---|
| 182 | </listitem> |
---|
| 183 | </varlistentry> |
---|
| 184 | |
---|
| 185 | <varlistentry id="efm_perl.pl"> |
---|
| 186 | <term><command>efm_perl.pl</command></term> |
---|
| 187 | <listitem> |
---|
| 188 | <para>Reformats the error messages of the Perl interpreter for use |
---|
| 189 | with the <quote>quickfix</quote> mode of <command>vim</command></para> |
---|
| 190 | <indexterm zone="ch-system-vim efm_perl.pl"> |
---|
| 191 | <primary sortas="b-efm_perl.pl">efm_perl.pl</primary> |
---|
| 192 | </indexterm> |
---|
| 193 | </listitem> |
---|
| 194 | </varlistentry> |
---|
| 195 | |
---|
| 196 | <varlistentry id="ex"> |
---|
| 197 | <term><command>ex</command></term> |
---|
| 198 | <listitem> |
---|
| 199 | <para>Starts <command>vim</command> in ex mode</para> |
---|
| 200 | <indexterm zone="ch-system-vim ex"> |
---|
| 201 | <primary sortas="b-ex">ex</primary> |
---|
| 202 | </indexterm> |
---|
| 203 | </listitem> |
---|
| 204 | </varlistentry> |
---|
| 205 | |
---|
| 206 | <varlistentry id="less.sh"> |
---|
| 207 | <term><command>less.sh</command></term> |
---|
| 208 | <listitem> |
---|
| 209 | <para>A script that starts <command>vim</command> with less.vim</para> |
---|
| 210 | <indexterm zone="ch-system-vim less.sh"> |
---|
| 211 | <primary sortas="b-less.sh">less.sh</primary> |
---|
| 212 | </indexterm> |
---|
| 213 | </listitem> |
---|
| 214 | </varlistentry> |
---|
| 215 | |
---|
| 216 | <varlistentry id="mve.awk"> |
---|
| 217 | <term><command>mve.awk</command></term> |
---|
| 218 | <listitem> |
---|
| 219 | <para>Processes <command>vim</command> errors</para> |
---|
| 220 | <indexterm zone="ch-system-vim mve.awk"> |
---|
| 221 | <primary sortas="b-mve.awk">mve.awk</primary> |
---|
| 222 | </indexterm> |
---|
| 223 | </listitem> |
---|
| 224 | </varlistentry> |
---|
| 225 | |
---|
| 226 | <varlistentry id="pltags.pl"> |
---|
| 227 | <term><command>pltags.pl</command></term> |
---|
| 228 | <listitem> |
---|
| 229 | <para>Creates a tags file for Perl code for use by |
---|
| 230 | <command>vim</command></para> |
---|
| 231 | <indexterm zone="ch-system-vim pltags.pl"> |
---|
| 232 | <primary sortas="b-pltags.pl">pltags.pl</primary> |
---|
| 233 | </indexterm> |
---|
| 234 | </listitem> |
---|
| 235 | </varlistentry> |
---|
| 236 | |
---|
| 237 | <varlistentry id="ref"> |
---|
| 238 | <term><command>ref</command></term> |
---|
| 239 | <listitem> |
---|
| 240 | <para>Checks the spelling of arguments</para> |
---|
| 241 | <indexterm zone="ch-system-vim ref"> |
---|
| 242 | <primary sortas="b-ref">ref</primary> |
---|
| 243 | </indexterm> |
---|
| 244 | </listitem> |
---|
| 245 | </varlistentry> |
---|
| 246 | |
---|
| 247 | <varlistentry id="rview"> |
---|
| 248 | <term><command>rview</command></term> |
---|
| 249 | <listitem> |
---|
| 250 | <para>Is a restricted version of <command>view</command>; no shell |
---|
| 251 | commands can be started and <command>view</command> cannot be |
---|
| 252 | suspended</para> |
---|
| 253 | <indexterm zone="ch-system-vim rview"> |
---|
| 254 | <primary sortas="b-rview">rview</primary> |
---|
| 255 | </indexterm> |
---|
| 256 | </listitem> |
---|
| 257 | </varlistentry> |
---|
| 258 | |
---|
| 259 | <varlistentry id="rvim"> |
---|
| 260 | <term><command>rvim</command></term> |
---|
| 261 | <listitem> |
---|
| 262 | <para>Is a restricted version of <command>vim</command>; no shell |
---|
| 263 | commands can be started and <command>vim</command> cannot be |
---|
| 264 | suspended</para> |
---|
| 265 | <indexterm zone="ch-system-vim rvim"> |
---|
| 266 | <primary sortas="b-rvim">rvim</primary> |
---|
| 267 | </indexterm> |
---|
| 268 | </listitem> |
---|
| 269 | </varlistentry> |
---|
| 270 | |
---|
| 271 | <varlistentry id="shtags.pl"> |
---|
| 272 | <term><command>shtags.pl</command></term> |
---|
| 273 | <listitem> |
---|
| 274 | <para>Generates a tags file for Perl scripts</para> |
---|
| 275 | <indexterm zone="ch-system-vim shtags.pl"> |
---|
| 276 | <primary sortas="b-shtags.pl">shtags.pl</primary> |
---|
| 277 | </indexterm> |
---|
| 278 | </listitem> |
---|
| 279 | </varlistentry> |
---|
| 280 | |
---|
| 281 | <varlistentry id="tcltags"> |
---|
| 282 | <term><command>tcltags</command></term> |
---|
| 283 | <listitem> |
---|
| 284 | <para>Generates a tags file for TCL code</para> |
---|
| 285 | <indexterm zone="ch-system-vim tcltags"> |
---|
| 286 | <primary sortas="b-tcltags">tcltags</primary> |
---|
| 287 | </indexterm> |
---|
| 288 | </listitem> |
---|
| 289 | </varlistentry> |
---|
| 290 | |
---|
| 291 | <varlistentry id="view"> |
---|
| 292 | <term><command>view</command></term> |
---|
| 293 | <listitem> |
---|
| 294 | <para>Starts <command>vim</command> in read-only mode</para> |
---|
| 295 | <indexterm zone="ch-system-vim view"> |
---|
| 296 | <primary sortas="b-view">view</primary> |
---|
| 297 | </indexterm> |
---|
| 298 | </listitem> |
---|
| 299 | </varlistentry> |
---|
| 300 | |
---|
| 301 | <varlistentry id="vi"> |
---|
| 302 | <term><command>vi</command></term> |
---|
| 303 | <listitem> |
---|
| 304 | <para>Link to <command>vim</command></para> |
---|
| 305 | <indexterm zone="ch-system-vim vi"> |
---|
| 306 | <primary sortas="b-vi">vi</primary> |
---|
| 307 | </indexterm> |
---|
| 308 | </listitem> |
---|
| 309 | </varlistentry> |
---|
| 310 | |
---|
| 311 | <varlistentry id="vim"> |
---|
| 312 | <term><command>vim</command></term> |
---|
| 313 | <listitem> |
---|
| 314 | <para>Is the editor</para> |
---|
| 315 | <indexterm zone="ch-system-vim vim"> |
---|
| 316 | <primary sortas="b-vim">vim</primary> |
---|
| 317 | </indexterm> |
---|
| 318 | </listitem> |
---|
| 319 | </varlistentry> |
---|
| 320 | |
---|
| 321 | <varlistentry id="vim132"> |
---|
| 322 | <term><command>vim132</command></term> |
---|
| 323 | <listitem> |
---|
| 324 | <para>Starts <command>vim</command> with the terminal in 132-column |
---|
| 325 | mode</para> |
---|
| 326 | <indexterm zone="ch-system-vim vim132"> |
---|
| 327 | <primary sortas="b-vim132">vim132</primary> |
---|
| 328 | </indexterm> |
---|
| 329 | </listitem> |
---|
| 330 | </varlistentry> |
---|
| 331 | |
---|
| 332 | <varlistentry id="vim2html.pl"> |
---|
| 333 | <term><command>vim2html.pl</command></term> |
---|
| 334 | <listitem> |
---|
| 335 | <para>Converts Vim documentation to HypterText Markup Language |
---|
| 336 | (HTML)</para> |
---|
| 337 | <indexterm zone="ch-system-vim vim2html.pl"> |
---|
| 338 | <primary sortas="b-vim2html.pl">vim2html.pl</primary> |
---|
| 339 | </indexterm> |
---|
| 340 | </listitem> |
---|
| 341 | </varlistentry> |
---|
| 342 | |
---|
| 343 | <varlistentry id="vimdiff"> |
---|
| 344 | <term><command>vimdiff</command></term> |
---|
| 345 | <listitem> |
---|
| 346 | <para>Edits two or three versions of a file with <command>vim</command> |
---|
| 347 | and show differences</para> |
---|
| 348 | <indexterm zone="ch-system-vim vimdiff"> |
---|
| 349 | <primary sortas="b-vimdiff">vimdiff</primary> |
---|
| 350 | </indexterm> |
---|
| 351 | </listitem> |
---|
| 352 | </varlistentry> |
---|
| 353 | |
---|
| 354 | <varlistentry id="vimm"> |
---|
| 355 | <term><command>vimm</command></term> |
---|
| 356 | <listitem> |
---|
| 357 | <para>Enables the DEC locator input model on a remote terminal</para> |
---|
| 358 | <indexterm zone="ch-system-vim vimm"> |
---|
| 359 | <primary sortas="b-vimm">vimm</primary> |
---|
| 360 | </indexterm> |
---|
| 361 | </listitem> |
---|
| 362 | </varlistentry> |
---|
| 363 | |
---|
| 364 | <varlistentry id="vimspell.sh"> |
---|
| 365 | <term><command>vimspell.sh</command></term> |
---|
| 366 | <listitem> |
---|
| 367 | <para>Spell checks a file and generates the syntax statements |
---|
| 368 | necessary to highlight in <command>vim</command>. This script |
---|
| 369 | requires the old Unix <command>spell</command> command, which |
---|
[0d4607d] | 370 | is provided neither in CLFS nor in CBLFS</para> |
---|
[3f8be484] | 371 | <indexterm zone="ch-system-vim vimspell.sh"> |
---|
| 372 | <primary sortas="b-vimspell.sh">vimspell.sh</primary> |
---|
| 373 | </indexterm> |
---|
| 374 | </listitem> |
---|
| 375 | </varlistentry> |
---|
| 376 | |
---|
| 377 | <varlistentry id="vimtutor"> |
---|
| 378 | <term><command>vimtutor</command></term> |
---|
| 379 | <listitem> |
---|
| 380 | <para>Teaches the basic keys and commands of |
---|
| 381 | <command>vim</command></para> |
---|
| 382 | <indexterm zone="ch-system-vim vimtutor"> |
---|
| 383 | <primary sortas="b-vimtutor">vimtutor</primary> |
---|
| 384 | </indexterm> |
---|
| 385 | </listitem> |
---|
| 386 | </varlistentry> |
---|
| 387 | |
---|
| 388 | <varlistentry id="xxd"> |
---|
| 389 | <term><command>xxd</command></term> |
---|
| 390 | <listitem> |
---|
| 391 | <para>Creates a hex dump of the given file; it can |
---|
| 392 | also do the reverse, so it can be used for binary patching</para> |
---|
| 393 | <indexterm zone="ch-system-vim xxd"> |
---|
| 394 | <primary sortas="b-xxd">xxd</primary> |
---|
| 395 | </indexterm> |
---|
| 396 | </listitem> |
---|
| 397 | </varlistentry> |
---|
| 398 | |
---|
| 399 | </variablelist> |
---|
| 400 | |
---|
| 401 | </sect2> |
---|
| 402 | |
---|
| 403 | </sect1> |
---|