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