source: postlfs/config/vimrc.xml@ 7aaad25

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 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 7aaad25 was 7aaad25, checked in by Larry Lawrence <larry@…>, 17 years ago

edit of vimrc to better tie in to LFS

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

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