annotate runtime/doc/usr_01.txt @ 6508:e1874a4524f8 v7.4.581

updated for version 7.4.581 Problem: Compiler warnings for unitinialized variables. (John Little) Solution: Initialize the variables.
author Bram Moolenaar <bram@vim.org>
date Sun, 18 Jan 2015 14:08:56 +0100
parents 359743c1f59a
children 9f48eab77d62
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5294
359743c1f59a release version 7.4
Bram Moolenaar <bram@vim.org>
parents: 5247
diff changeset
1 *usr_01.txt* For Vim version 7.4. Last change: 2010 Nov 03
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 VIM USER MANUAL - by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 About the manuals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 This chapter introduces the manuals available with Vim. Read this to know the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 conditions under which the commands are explained.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 |01.1| Two manuals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 |01.2| Vim installed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 |01.3| Using the Vim tutor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 |01.4| Copyright
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 Next chapter: |usr_02.txt| The first steps in Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 Table of contents: |usr_toc.txt|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 *01.1* Two manuals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 The Vim documentation consists of two parts:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 1. The User manual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 Task oriented explanations, from simple to complex. Reads from start to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 end like a book.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 2. The Reference manual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 Precise description of how everything in Vim works.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 The notation used in these manuals is explained here: |notation|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 JUMPING AROUND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 The text contains hyperlinks between the two parts, allowing you to quickly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 jump between the description of an editing task and a precise explanation of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 the commands and options used for it. Use these two commands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 Press CTRL-] to jump to a subject under the cursor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 Press CTRL-O to jump back (repeat to go further back).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
2642
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
43 Many links are in vertical bars, like this: |bars|. The bars themselves may
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
44 be hidden or invisible, see below. An option name, like 'number', a command
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
45 in double quotes like ":write" and any other word can also be used as a link.
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
46 Try it out: Move the cursor to CTRL-] and press CTRL-] on it.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 Other subjects can be found with the ":help" command, see |help.txt|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
2642
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
50 The bars and stars are usually hidden with the |conceal| feature. They also
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
51 use |hl-Ignore|, using the same color for the text as the background. You can
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
52 make them visible with: >
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
53 :set conceallevel=0
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
54 :hi link HelpBar Normal
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
55 :hi link HelpStar Normal
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
56
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 *01.2* Vim installed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 Most of the manuals assume that Vim has been properly installed. If you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 didn't do that yet, or if Vim doesn't run properly (e.g., files can't be found
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 or in the GUI the menus do not show up) first read the chapter on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 installation: |usr_90.txt|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 *not-compatible*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 The manuals often assume you are using Vim with Vi-compatibility switched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 off. For most commands this doesn't matter, but sometimes it is important,
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
67 e.g., for multi-level undo. An easy way to make sure you are using a nice
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
68 setup is to copy the example vimrc file. By doing this inside Vim you don't
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
69 have to check out where it is located. How to do this depends on the system
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
70 you are using:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 Unix: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 :!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 MS-DOS, MS-Windows, OS/2: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 :!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 Amiga: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 :!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 If the file already exists you probably want to keep it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 If you start Vim now, the 'compatible' option should be off. You can check it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 with this command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 :set compatible?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 If it responds with "nocompatible" you are doing well. If the response is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 "compatible" you are in trouble. You will have to find out why the option is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 still set. Perhaps the file you wrote above is not found. Use this command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 to find out: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 :scriptnames
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 If your file is not in the list, check its location and name. If it is in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 list, there must be some other place where the 'compatible' option is switched
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 back on.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 For more info see |vimrc| and |compatible-default|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 Note:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 This manual is about using Vim in the normal way. There is an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 alternative called "evim" (easy Vim). This is still Vim, but used in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 a way that resembles a click-and-type editor like Notepad. It always
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 stays in Insert mode, thus it feels very different. It is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 explained in the user manual, since it should be mostly self
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 explanatory. See |evim-keys| for details.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 *01.3* Using the Vim tutor *tutor* *vimtutor*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 Instead of reading the text (boring!) you can use the vimtutor to learn your
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 first Vim commands. This is a 30 minute tutorial that teaches the most basic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 Vim functionality hands-on.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
24
8ff7fd162d3c updated for version 7.0016
vimboss
parents: 7
diff changeset
114 On Unix, if Vim has been properly installed, you can start it from the shell:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 vimtutor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
24
8ff7fd162d3c updated for version 7.0016
vimboss
parents: 7
diff changeset
118 On MS-Windows you can find it in the Program/Vim menu. Or execute
8ff7fd162d3c updated for version 7.0016
vimboss
parents: 7
diff changeset
119 vimtutor.bat in the $VIMRUNTIME directory.
8ff7fd162d3c updated for version 7.0016
vimboss
parents: 7
diff changeset
120
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 This will make a copy of the tutor file, so that you can edit it without
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 the risk of damaging the original.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 There are a few translated versions of the tutor. To find out if yours is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 available, use the two-letter language code. For French: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 vimtutor fr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1269
diff changeset
128 On Unix, if you prefer using the GUI version of Vim, use "gvimtutor" or
149d8b46404c updated for version 7.2a
vimboss
parents: 1269
diff changeset
129 "vimtutor -g" instead of "vimtutor".
149d8b46404c updated for version 7.2a
vimboss
parents: 1269
diff changeset
130
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 For OpenVMS, if Vim has been properly installed, you can start vimtutor from a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 VMS prompt with: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 @VIM:vimtutor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 Optionally add the two-letter language code as above.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 On other systems, you have to do a little work:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 1. Copy the tutor file. You can do this with Vim (it knows where to find it):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 This will write the file "TUTORCOPY" in the current directory. To use a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 translated version of the tutor, append the two-letter language code to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 filename. For French:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 2. Edit the copied file with Vim:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 vim -u NONE -c "set nocp" TUTORCOPY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 The extra arguments make sure Vim is started in a good mood.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 3. Delete the copied file when you are finished with it:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 del TUTORCOPY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 *01.4* Copyright *manual-copyright*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 24
diff changeset
165 Moolenaar. This material may be distributed only subject to the terms and
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 conditions set forth in the Open Publication License, v1.0 or later. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 latest version is presently available at:
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
168 http://www.opencontent.org/openpub/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 People who contribute to the manuals must agree with the above copyright
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 notice.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 *frombook*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 Parts of the user manual come from the book "Vi IMproved - Vim" by Steve
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 Oualline (published by New Riders Publishing, ISBN: 0735710015). The Open
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 Publication License applies to this book. Only selected parts are included
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 and these have been modified (e.g., by removing the pictures, updating the
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
177 text for Vim 6.0 and later, fixing mistakes). The omission of the |frombook|
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
178 tag does not mean that the text does not come from the book.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 Many thanks to Steve Oualline and New Riders for creating this book and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 publishing it under the OPL! It has been a great help while writing the user
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 manual. Not only by providing literal text, but also by setting the tone and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 style.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 If you make money through selling the manuals, you are strongly encouraged to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 donate part of the profit to help AIDS victims in Uganda. See |iccf|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 Next chapter: |usr_02.txt| The first steps in Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl: