Creating a system-wide vimrc file, as suggested by Greg.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3079 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Alex Gronenwoud 2003-11-13 22:30:39 +00:00
parent 695d6f2ee6
commit 0ba2766b69
3 changed files with 32 additions and 16 deletions

View File

@ -44,10 +44,16 @@ symlink.</para></listitem>
Automake-1.7.9, File-4.06, Modutils-2.4.26, Procps-3.1.14 and Automake-1.7.9, File-4.06, Modutils-2.4.26, Procps-3.1.14 and
Sed-4.0.8.</para></listitem> Sed-4.0.8.</para></listitem>
<listitem><para>November 13th, 2003 [alex]: Chapter 6 - Vim: Changed from
creating a local <filename>/root/.vimrc</filename> to a system-wide
<filename>/etc/vimrc</filename> file .</para></listitem>
<listitem><para>November 12th, 2003 [greg]: Upgraded to <listitem><para>November 12th, 2003 [greg]: Upgraded to
GCC-3.3.2.</para></listitem> GCC-3.3.2.</para></listitem>
</itemizedlist> </itemizedlist>
<para>Release of version 5.0 on November 5th, 2003.</para>
</sect1> </sect1>

View File

@ -2,19 +2,28 @@
<sect2><title>Configuring Vim</title> <sect2><title>Configuring Vim</title>
<para>By default, vim runs in vi compatible mode. Some people might like this, <para>By default, <userinput>vim</userinput> runs in vi-compatible mode. Some
but we have a high preference to run vim in vim mode (else we wouldn't people might like this, but we prefer to run <userinput>vim</userinput> in its
have included vim in this book, but the original vi). Create the own mode (else we wouldn't have included it in this book, but the original
<filename>/root/.vimrc</filename> by running the following:</para> <userinput>vi</userinput>). Create a default vim configuration file by running
the following:</para>
<screen><userinput>cat &gt; /root/.vimrc &lt;&lt; "EOF"</userinput> <screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
" Begin /root/.vimrc " Begin /etc/vimrc
set nocompatible set nocompatible
set bs=2 set backspace=2
syntax on
" End /root/.vimrc " End /etc/vimrc
<userinput>EOF</userinput></screen> <userinput>EOF</userinput></screen>
<para>The <userinput>set nocompatible</userinput> will make
<userinput>vim</userinput> behave in a more useful way than the default
vi-compatible manner. The <userinput>set backspace=2</userinput> allows
backspacing over line breaks, autoindent and the start of insert. And the
<userinput>syntax on</userinput> switches on <userinput>vim</userinput>'s
semantic colouring.</para>
</sect2> </sect2>

View File

@ -22,7 +22,7 @@ suggested installation instructions.</para>
<sect2> <sect2>
<title>Installation of Vim</title> <title>Installation of Vim</title>
<para>Change the default locations of the <filename>vimrc</filename> and <para>First change the default locations of the <filename>vimrc</filename> and
<filename>gvimrc</filename> files to <filename <filename>gvimrc</filename> files to <filename
class="directory">/etc</filename>.</para> class="directory">/etc</filename>.</para>
@ -41,18 +41,19 @@ echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' &gt;&gt; src/feature.h</userinput><
<screen><userinput>make install</userinput></screen> <screen><userinput>make install</userinput></screen>
<para>Vim can run in old-fashioned <emphasis>vi</emphasis> mode by <para>When called as <userinput>vi</userinput>, <userinput>vim</userinput>
creating a symlink, which may be created with the following command:</para> will run in old-fashioned vi-mode. To allow this, create a symlink:</para>
<screen><userinput>ln -s vim /usr/bin/vi</userinput></screen> <screen><userinput>ln -s vim /usr/bin/vi</userinput></screen>
<para>If you plan to install the X Window system on your LFS <para>If you are going to install the X Window system on your LFS system, you
system, you might want to re-compile Vim after you have installed X. Vim may want to re-compile Vim after having installed X. Vim comes with a nice GUI
comes with a nice GUI version of the editor which requires X and a few version of the editor that requires X and a few other libraries to be
other libraries to be installed. For more information read the Vim installed. For more information read the Vim documentation.</para>
documentation.</para>
</sect2> </sect2>
&c6-cf-vim; &c6-cf-vim;
</sect1> </sect1>