source: postlfs/config/vimrc.xml@ 1dad4a4

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v5_1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 1dad4a4 was 1ea79a1, checked in by Bruce Dubbs <bdubbs@…>, 20 years ago

Typos and punctuation

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

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