vim.xml 3.1 KB

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