[3be4d97] | 1 | <sect1 id="ch-system-vim" xreflabel="Vim">
|
---|
[793c2f7] | 2 | <title>Installing Vim-&vim-version;</title>
|
---|
[576e206] | 3 | <?dbhtml filename="vim.html" dir="chapter06"?>
|
---|
[6370fa6] | 4 |
|
---|
[5888299] | 5 | <para>The Vim package contains a powerful text editor.</para>
|
---|
| 6 |
|
---|
[69276a94] | 7 | <screen>&buildtime; &vim-time;
|
---|
| 8 | &diskspace; &vim-compsize;</screen>
|
---|
[3554fa3a] | 9 |
|
---|
[5888299] | 10 | &aa-vim-down;
|
---|
| 11 | &aa-vim-dep;
|
---|
| 12 |
|
---|
| 13 | <sect2><title> </title><para> </para></sect2>
|
---|
| 14 |
|
---|
[35c2fa60] | 15 | <sect2>
|
---|
| 16 | <title>Alternatives to Vim</title>
|
---|
| 17 | <para>If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim,
|
---|
[f861982] | 18 | have a look at <ulink url="&blfs-root;view/stable/postlfs/editors.html"/> for
|
---|
[35c2fa60] | 19 | suggested installation instructions.</para>
|
---|
| 20 | </sect2>
|
---|
| 21 |
|
---|
[73aedd1d] | 22 | <sect2><title> </title><para> </para></sect2>
|
---|
| 23 |
|
---|
| 24 | <sect2>
|
---|
| 25 | <title>Installation of Vim</title>
|
---|
| 26 |
|
---|
[0ba2766b] | 27 | <para>First change the default locations of the <filename>vimrc</filename> and
|
---|
[73aedd1d] | 28 | <filename>gvimrc</filename> files to <filename
|
---|
| 29 | class="directory">/etc</filename>.</para>
|
---|
| 30 |
|
---|
| 31 | <screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
|
---|
| 32 | echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h</userinput></screen>
|
---|
| 33 |
|
---|
| 34 | <para>Now prepare Vim for compilation:</para>
|
---|
| 35 |
|
---|
| 36 | <screen><userinput>./configure --prefix=/usr</userinput></screen>
|
---|
| 37 |
|
---|
| 38 | <para>Compile the package:</para>
|
---|
| 39 |
|
---|
| 40 | <screen><userinput>make</userinput></screen>
|
---|
| 41 |
|
---|
[8a5f906] | 42 | <para>To have the results tested, you can issue:
|
---|
| 43 | <userinput>make check</userinput>. However, this test suite outputs a lot of
|
---|
| 44 | seemingly garbage characters to the screen, and this can wreak havoc with the
|
---|
| 45 | settings of the current terminal. Accordingly, the running of the test suite
|
---|
| 46 | here is strictly optional.</para>
|
---|
[1a73ed4] | 47 |
|
---|
[73aedd1d] | 48 | <para>And install the package:</para>
|
---|
| 49 |
|
---|
| 50 | <screen><userinput>make install</userinput></screen>
|
---|
| 51 |
|
---|
[90e3cb3] | 52 | <para>When called as <command>vi</command>, <command>vim</command>
|
---|
[0ba2766b] | 53 | will run in old-fashioned vi-mode. To allow this, create a symlink:</para>
|
---|
[73aedd1d] | 54 |
|
---|
| 55 | <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
|
---|
| 56 |
|
---|
[0ba2766b] | 57 | <para>If you are going to install the X Window system on your LFS system, you
|
---|
| 58 | may want to re-compile Vim after having installed X. Vim comes with a nice GUI
|
---|
| 59 | version of the editor that requires X and a few other libraries to be
|
---|
| 60 | installed. For more information read the Vim documentation.</para>
|
---|
[73aedd1d] | 61 |
|
---|
| 62 | </sect2>
|
---|
[0ba2766b] | 63 |
|
---|
[342b176] | 64 | <sect2><title> </title><para> </para></sect2>
|
---|
| 65 |
|
---|
| 66 | <sect2><title>Configuring Vim</title>
|
---|
| 67 |
|
---|
| 68 | <para>By default, <command>vim</command> runs in vi-compatible mode. Some
|
---|
| 69 | people might like this, but we prefer to run <command>vim</command> in its
|
---|
| 70 | own mode (else we wouldn't have included it in this book, but the original
|
---|
| 71 | <command>vi</command>). Create a default vim configuration file by running
|
---|
| 72 | the following:</para>
|
---|
| 73 |
|
---|
| 74 | <screen><userinput>cat > /etc/vimrc << "EOF"</userinput>
|
---|
| 75 | " Begin /etc/vimrc
|
---|
| 76 |
|
---|
| 77 | set nocompatible
|
---|
| 78 | set backspace=2
|
---|
| 79 | syntax on
|
---|
| 80 |
|
---|
| 81 | " End /etc/vimrc
|
---|
| 82 | <userinput>EOF</userinput></screen>
|
---|
| 83 |
|
---|
| 84 | <para>The <emphasis>set nocompatible</emphasis> will make
|
---|
| 85 | <command>vim</command> behave in a more useful way than the default
|
---|
| 86 | vi-compatible manner. The <emphasis>set backspace=2</emphasis> allows
|
---|
| 87 | backspacing over line breaks, autoindent and the start of insert. And the
|
---|
| 88 | <emphasis>syntax on</emphasis> switches on <command>vim</command>'s
|
---|
| 89 | semantic colouring.</para>
|
---|
| 90 |
|
---|
| 91 | </sect2>
|
---|
[0ba2766b] | 92 |
|
---|
[5888299] | 93 | &aa-vim-shortdesc;
|
---|
| 94 | &aa-vim-desc;
|
---|
| 95 |
|
---|
[6370fa6] | 96 | </sect1>
|
---|
[73aedd1d] | 97 |
|
---|