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 @@ 2018-01-30 + + [bdubbs] - Make /etc/vimrc set defaults properly. + [dj] - Update to systemd-237. Fixes #4203. 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 cat > /etc/vimrc << "EOF" " 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 (&term == "xterm") || (&term == "putty") set background=dark @@ -138,9 +142,7 @@ endif " End /etc/vimrc -EOF - -touch ~/.vimrc +EOF The set nocompatible setting makes vim behave in a more useful way (the default) than the @@ -148,18 +150,18 @@ touch ~/.vimrc vi behavior. The set backspace=2 setting allows backspacing over line breaks, autoindents, and the start of insert. The syntax on parameter enables vim's syntax - highlighting. The set mouse=r setting enables + highlighting. The set mouse= setting enables proper pasting of text with the mouse when working in chroot or over a remote connection. Finally, the if statement with the set background=dark setting corrects vim'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. - + Documentation for other available options can be obtained by running the following command: