source: postlfs/config/vimrc.xml@ 76d61ba

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 76d61ba was 6c63b55, checked in by Dan Nichilson <dnicholson@…>, 18 years ago

Various text updates and link corrections reported on the lists.

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

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