aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/config-vim.xml
blob: ab9aea8bf61aa30f14bbb3e1ac133a1a55145337 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>

<sect2><title>Configuring Vim</title>

<para>By default, <userinput>vim</userinput> runs in vi-compatible mode. Some
people might like this, but we prefer to run <userinput>vim</userinput> in its
own mode (else we wouldn't have included it in this book, but the original
<userinput>vi</userinput>). Create a default vim configuration file by running
the following:</para>

<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
" Begin /etc/vimrc

set nocompatible
set backspace=2
syntax on

" End /etc/vimrc
<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>