aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2018-01-30 18:35:44 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2018-01-30 18:35:44 +0000
commit173aea3c22a648219286575b96fe11030df56bb5 (patch)
tree88c5b6ac9c95e6e572da6fc5bdc1b77a9591de2f
parent73b3eb9fe5c970188b60c6ce5b229efadae4dcc1 (diff)
Update /etc/vimrc to set defaults properly
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11358 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r--chapter01/changelog.xml3
-rw-r--r--chapter06/vim.xml16
2 files changed, 12 insertions, 7 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index 86907dd71..09ef2f351 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -45,6 +45,9 @@
<listitem>
<para>2018-01-30</para>
<itemizedlist>
+ <listitem>
+ <para>[bdubbs] - Make /etc/vimrc set defaults properly.</para>
+ </listitem>
<listitem revision="systemd">
<para>[dj] - Update to systemd-237. Fixes
<ulink url="&lfs-ticket-root;4203">#4203</ulink>.</para>
diff --git a/chapter06/vim.xml b/chapter06/vim.xml
index 6b06c01f1..fa2bad722 100644
--- a/chapter06/vim.xml
+++ b/chapter06/vim.xml
@@ -128,9 +128,13 @@ done</userinput></screen>
<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"
<literal>" Begin /etc/vimrc
+" Ensure defaults are set before customizing settings, not after
+source $VIMRUNTIME/defaults.vim
+let skip_defaults_vim=1
+
set nocompatible
set backspace=2
-set mouse=r
+set mouse=
syntax on
if (&amp;term == "xterm") || (&amp;term == "putty")
set background=dark
@@ -138,9 +142,7 @@ endif
" End /etc/vimrc</literal>
-EOF
-
-touch ~/.vimrc</userinput></screen>
+EOF</userinput></screen>
<para>The <parameter>set nocompatible</parameter> setting makes
<command>vim</command> behave in a more useful way (the default) than the
@@ -148,18 +150,18 @@ touch ~/.vimrc</userinput></screen>
<command>vi</command> behavior. The <parameter>set backspace=2</parameter>
setting allows backspacing over line breaks, autoindents, and the start of
insert. The <parameter>syntax on</parameter> parameter enables vim's syntax
- highlighting. The <parameter>set mouse=r</parameter> setting enables
+ highlighting. The <parameter>set mouse=</parameter> setting enables
proper pasting of text with the mouse when working in chroot or over a
remote connection. Finally, the <emphasis>if</emphasis> statement with the
<parameter>set background=dark</parameter> setting corrects
<command>vim</command>'s guess about the background color of some terminal
emulators. This gives the highlighting a better color scheme for use on the
black background of these programs.</para>
-
+<!--
<para>Creating an empty <filename>~/.vimrc</filename> prevents vim from
overriding settings in <filename>/etc/vimrc</filename> by using
<filename>/usr/share/vim/vim80/defaults.vim</filename>.</para>
-
+-->
<para>Documentation for other available options can be obtained by
running the following command:</para>