source: postlfs/config/vimrc.xml@ 01600b9

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 01600b9 was 01600b9, checked in by Larry Lawrence <larry@…>, 19 years ago

update to sendmail-8.12.9

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@821 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 3.3 KB
Line 
1<sect1 id="postlfs-config-vimrc">
2<?dbhtml filename="vimrc.html" dir="postlfs"?>
3<title>/etc/vimrc, ~/.vimrc</title>
4
5<para>The LFS book installs vim as its editor. At this point we should
6state that there are a <emphasis>lot</emphasis> of different editors out
7there including emacs, nano, joe and many more. Anyone who has been
8around the Internet (especially usenet) for a short time will certainly
9have observed at least one flame war, usually involving vim and emacs
10users!</para>
11
12<para>The LFS book gives a basic <filename>vimrc</filename> file. Here,
13we attempt to enhance this file. At startup, vim reads
14<filename>/etc/vimrc</filename> and <filename>~/.vimrc</filename>
15(i.e., the global vimrc and the user-specific one.). Note that this is
16only true if you compiled vim using LFS-3.1 onwards. Prior to this,
17the global vimrc was <filename>/usr/share/vim/vimrc</filename>.</para>
18
19<para>Here is an example of a slightly expanded vimrc:</para>
20
21<para><screen>" Begin .vimrc
22
23set nocompatible
24set bs=2
25set columns=80
26set background=dark
27set tabstop=8
28set wrapmargin=8
29set nobk
30syntax on
31set ruler
32set noexpandtab
33
34" End .vimrc</screen></para>
35
36<para>A FAQ on the lfs lists regards the comment tags in vimrc. Note
37that they are " instead of the more usual # or //. This is correct, the
38syntax for vimrc is slightly unusual.</para>
39
40<para>We'll run through a quick explanation of what each of the
41options in this example file means here:</para>
42<itemizedlist>
43<listitem><para><userinput>set nocompatible</userinput> : This option stops vim from behaving in a strongly vi-compatible way. It
44should be at the start of any vimrc file as it can affect lots of other
45options which you may want to override.</para></listitem>
46
47<listitem><para><userinput>set bs=2</userinput> : This influences the behavior of the backspace option. It is fairly
48complex so see <userinput>:help 'bs'</userinput> for more
49details.</para></listitem>
50
51<listitem><para><userinput>set columns=80</userinput> : This simply sets the number of columns used on the
52screen.</para></listitem>
53
54<listitem><para><userinput>set background=dark</userinput> : This tells vim to use colors which look good on a dark
55background.</para></listitem>
56
57<listitem><para><userinput>set tabstop=8</userinput> : The number of spaces which a tabstop takes.</para></listitem>
58
59<listitem><para><userinput>set wrapmargin=8</userinput> : This is the number of characters from the right window
60border where wrapping starts.</para></listitem>
61
62<listitem><para><userinput>set nobk</userinput> : This stops vim from creating a backup before
63overwriting a file.</para></listitem>
64
65<listitem><para><userinput>syntax on</userinput> : Enables vim's syntax highlighting.</para></listitem>
66
67<listitem><para><userinput>set ruler</userinput> : This makes vim show the current row and column at the bottom right of
68the screen.</para></listitem>
69
70<listitem><para><userinput>set noexpandtab</userinput> : This makes vim insert tabs as tab characters instead of as a set of
71spaces.</para></listitem>
72
73</itemizedlist>
74
75<para>More information on the <emphasis>many</emphasis> vim options
76can be found by reading the help inside vim itself. Do this by typing
77<userinput>:help</userinput> in vim to get the general help, or by
78typing <userinput>:help usr_toc.txt</userinput> to view the User Manual
79Table of Contents.</para>
80
81</sect1>
82
Note: See TracBrowser for help on using the repository browser.