annotate runtime/tutor/tutor @ 30092:53e7e912eeec v9.0.0382

patch 9.0.0382: freeing the wrong string on failure Commit: https://github.com/vim/vim/commit/31ea6bf530a814991f669122dbc9921117a862c3 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 5 10:47:13 2022 +0100 patch 9.0.0382: freeing the wrong string on failure Problem: Freeing the wrong string on failure. Solution: Adjust the argument. Reorder the code.
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Sep 2022 12:00:06 +0200
parents 179c118424a6
children cc751d944b7e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 ===============================================================================
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
2 = W e l c o m e t o t h e V I M T u t o r - Version 1.7 =
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 ===============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 Vim is a very powerful editor that has many commands, too many to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 explain in a tutor such as this. This tutor is designed to describe
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 enough of the commands that you will be able to easily use Vim as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 an all-purpose editor.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
19968
1908e92b02fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
10 The approximate time required to complete the tutor is 30 minutes,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 depending upon how much time is spent with experimentation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
13 ATTENTION:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 The commands in the lessons will modify the text. Make a copy of this
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
15 file to practice on (if you started "vimtutor" this is already a copy).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 It is important to remember that this tutor is set up to teach by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 use. That means that you need to execute the commands to learn them
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 properly. If you only read the text, you will forget the commands!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
13231
167a030448fa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12499
diff changeset
21 Now, make sure that your Caps-Lock key is NOT depressed and press
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
22 the j key enough times to move the cursor so that lesson 1.1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 completely fills the screen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 Lesson 1.1: MOVING THE CURSOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 ** To move the cursor, press the h,j,k,l keys as indicated. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 ^
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 k Hint: The h key is at the left and moves left.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 < h l > The l key is at the right and moves right.
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
32 j The j key looks like a down arrow.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 1. Move the cursor around the screen until you are comfortable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 2. Hold down the down key (j) until it repeats.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
37 Now you know how to move to the next lesson.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
39 3. Using the down key, move to lesson 1.2.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
41 NOTE: If you are ever unsure about something you typed, press <ESC> to place
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 you in Normal mode. Then retype the command you wanted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
44 NOTE: The cursor keys should also work. But using hjkl you will be able to
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
45 move around much faster, once you get used to it. Really!
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
48 Lesson 1.2: EXITING VIM
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 !! NOTE: Before executing any of the steps below, read this entire lesson!!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 1. Press the <ESC> key (to make sure you are in Normal mode).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
55 2. Type: :q! <ENTER>.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
56 This exits the editor, DISCARDING any changes you have made.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
5555
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3847
diff changeset
58 3. Get back here by executing the command that got you into this tutor. That
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3847
diff changeset
59 might be: vimtutor <ENTER>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 4. If you have these steps memorized and are confident, execute steps
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
62 1 through 3 to exit and re-enter the editor.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
63
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
64 NOTE: :q! <ENTER> discards any changes you made. In a few lessons you
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
65 will learn how to save the changes to a file.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
66
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
67 5. Move the cursor down to lesson 1.3.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
68
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
69
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 Lesson 1.3: TEXT EDITING - DELETION
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
74 ** Press x to delete the character under the cursor. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 1. Move the cursor to the line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 2. To fix the errors, move the cursor until it is on top of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 character to be deleted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 3. Press the x key to delete the unwanted character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 4. Repeat steps 2 through 4 until the sentence is correct.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 ---> The ccow jumpedd ovverr thhe mooon.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
87 5. Now that the line is correct, go on to lesson 1.4.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 NOTE: As you go through this tutor, do not try to memorize, learn by usage.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
94 Lesson 1.4: TEXT EDITING - INSERTION
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
97 ** Press i to insert text. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 1. Move the cursor to the first line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 2. To make the first line the same as the second, move the cursor on top
15878
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 14347
diff changeset
102 of the character BEFORE which the text is to be inserted.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 3. Press i and type in the necessary additions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 4. As each error is fixed press <ESC> to return to Normal mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 Repeat steps 2 through 4 to correct the sentence.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 ---> There is text misng this .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 ---> There is some text missing from this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
112 5. When you are comfortable inserting text move to lesson 1.5.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
117 Lesson 1.5: TEXT EDITING - APPENDING
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
118
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
119
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
120 ** Press A to append text. **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
121
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
122 1. Move the cursor to the first line below marked --->.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
123 It does not matter on what character the cursor is in that line.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
124
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
125 2. Press A and type in the necessary additions.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
126
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
127 3. As the text has been appended press <ESC> to return to Normal mode.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
128
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
129 4. Move the cursor to the second line marked ---> and repeat
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
130 steps 2 and 3 to correct this sentence.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
131
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
132 ---> There is some text missing from th
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
133 There is some text missing from this line.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
134 ---> There is also some text miss
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
135 There is also some text missing here.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
136
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
137 5. When you are comfortable appending text move to lesson 1.6.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
138
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
139 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
140 Lesson 1.6: EDITING A FILE
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
141
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
142 ** Use :wq to save a file and exit. **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
143
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
144 !! NOTE: Before executing any of the steps below, read this entire lesson!!
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
145
25700
d4faa2c5211b Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
146 1. If you have access to another terminal, do the following there.
d4faa2c5211b Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
147 Otherwise, exit this tutor as you did in lesson 1.2: :q!
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
148
25700
d4faa2c5211b Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
149 2. At the shell prompt type this command: vim file.txt <ENTER>
d4faa2c5211b Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
150 'vim' is the command to start the Vim editor, 'file.txt' is the name of
d4faa2c5211b Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
151 the file you wish to edit. Use the name of a file that you can change.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
152
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
153 3. Insert and delete text as you learned in the previous lessons.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
154
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
155 4. Save the file with changes and exit Vim with: :wq <ENTER>
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
156
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1123
diff changeset
157 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to
149d8b46404c updated for version 7.2a
vimboss
parents: 1123
diff changeset
158 the following summary.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
159
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
160 6. After reading the above steps and understanding them: do it.
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
161
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
162 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
163 Lesson 1 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 1. The cursor is moved using either the arrow keys or the hjkl keys.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 h (left) j (down) k (up) l (right)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
169 2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 OR type: <ESC> :wq <ENTER> to save the changes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
174 4. To delete the character at the cursor type: x
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
176 5. To insert or append text type:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
177 i type inserted text <ESC> insert before the cursor
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
178 A type appended text <ESC> append after the line
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 NOTE: Pressing <ESC> will place you in Normal mode or will cancel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 an unwanted and partially completed command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
183 Now continue with lesson 2.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 Lesson 2.1: DELETION COMMANDS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
189 ** Type dw to delete a word. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 1. Press <ESC> to make sure you are in Normal mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 2. Move the cursor to the line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 3. Move the cursor to the beginning of a word that needs to be deleted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 4. Type dw to make the word disappear.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
199 NOTE: The letter d will appear on the last line of the screen as you type
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
200 it. Vim is waiting for you to type w . If you see another character
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
201 than d you typed something wrong; press <ESC> and start over.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 ---> There are a some words fun that don't belong paper in this sentence.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
205 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 2.2.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 Lesson 2.2: MORE DELETION COMMANDS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 ** Type d$ to delete to the end of the line. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 1. Press <ESC> to make sure you are in Normal mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 2. Move the cursor to the line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 3. Move the cursor to the end of the correct line (AFTER the first . ).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 4. Type d$ to delete to the end of the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 ---> Somebody typed the end of this line twice. end of this line twice.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
225 5. Move on to lesson 2.3 to understand what is happening.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
232 Lesson 2.3: ON OPERATORS AND MOTIONS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
235 Many commands that change text are made from an operator and a motion.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
236 The format for a delete command with the d delete operator is as follows:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
238 d motion
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
239
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 Where:
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
241 d - is the delete operator.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
242 motion - is what the operator will operate on (listed below).
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
243
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
244 A short list of motions:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
245 w - until the start of the next word, EXCLUDING its first character.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
246 e - to the end of the current word, INCLUDING the last character.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
247 $ - to the end of the line, INCLUDING the last character.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
248
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
249 Thus typing de will delete from the cursor to the end of the word.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
250
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
251 NOTE: Pressing just the motion while in Normal mode without an operator will
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
252 move the cursor as specified.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
254 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
255 Lesson 2.4: USING A COUNT FOR A MOTION
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
256
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
257
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
258 ** Typing a number before a motion repeats it that many times. **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
259
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
260 1. Move the cursor to the start of the line below marked --->.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
261
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
262 2. Type 2w to move the cursor two words forward.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
264 3. Type 3e to move the cursor to the end of the third word forward.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
265
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
266 4. Type 0 (zero) to move to the start of the line.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
267
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
268 5. Repeat steps 2 and 3 with different numbers.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
269
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
270 ---> This is just a line with words you can move around in.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
271
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
272 6. Move on to lesson 2.5.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
278 Lesson 2.5: USING A COUNT TO DELETE MORE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
281 ** Typing a number with an operator repeats it that many times. **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
282
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
283 In the combination of the delete operator and a motion mentioned above you
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
284 insert a count before the motion to delete more:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
285 d number motion
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
286
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
287 1. Move the cursor to the first UPPER CASE word in the line marked --->.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
288
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
289 2. Type d2w to delete the two UPPER CASE words.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
290
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
291 3. Repeat steps 1 and 2 with a different count to delete the consecutive
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
292 UPPER CASE words with one command.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
293
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
294 ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
295
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
296
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
297
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
298
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
299
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
300 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
301 Lesson 2.6: OPERATING ON LINES
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
302
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
303
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
304 ** Type dd to delete a whole line. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 Due to the frequency of whole line deletion, the designers of Vi decided
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
307 it would be easier to simply type two d's to delete a line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 1. Move the cursor to the second line in the phrase below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 2. Type dd to delete the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 3. Now move to the fourth line.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
312 4. Type 2dd to delete two lines.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
314 ---> 1) Roses are red,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
315 ---> 2) Mud is fun,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
316 ---> 3) Violets are blue,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
317 ---> 4) I have a car,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
318 ---> 5) Clocks tell time,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
319 ---> 6) Sugar is sweet
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
320 ---> 7) And so are you.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321
22958
e7c125224b1a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22171
diff changeset
322 Doubling to operate on a line also works for operators mentioned below.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
325 Lesson 2.7: THE UNDO COMMAND
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
328 ** Press u to undo the last commands, U to fix a whole line. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 1. Move the cursor to the line below marked ---> and place it on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 first error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 2. Type x to delete the first unwanted character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 3. Now type u to undo the last command executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 4. This time fix all the errors on the line using the x command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 5. Now type a capital U to return the line to its original state.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 6. Now type u a few times to undo the U and preceding commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 to redo the commands (undo the undo's).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 ---> Fiix the errors oon thhis line and reeplace them witth undo.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
342 8. These are very useful commands. Now move on to the lesson 2 Summary.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
348 Lesson 2 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
350 1. To delete from the cursor up to the next word type: dw
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
351 2. To delete from the cursor up to the end of the word type: de
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
352 3. To delete from the cursor to the end of a line type: d$
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
353 4. To delete a whole line type: dd
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
355 5. To repeat a motion prepend it with a number: 2w
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
356 6. The format for a change command is:
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
357 operator [number] motion
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 where:
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
359 operator - is what to do, such as d for delete
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
360 [number] - is an optional count to repeat the motion
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
361 motion - moves over the text to operate on, such as w (word),
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
362 e (end of word), $ (end of the line), etc.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
364 7. To move to the start of the line use a zero: 0
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
365
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
366 8. To undo previous actions, type: u (lowercase u)
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
367 To undo all the changes on a line, type: U (capital U)
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
368 To undo the undo's, type: CTRL-R
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 Lesson 3.1: THE PUT COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
374 ** Type p to put previously deleted text after the cursor. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375
14347
723487cd7876 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14249
diff changeset
376 1. Move the cursor to the first line below marked --->.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
378 2. Type dd to delete the line and store it in a Vim register.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
380 3. Move the cursor to the c) line, ABOVE where the deleted line should go.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
382 4. Type p to put the line below the cursor.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 5. Repeat steps 2 through 4 to put all the lines in correct order.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
386 ---> d) Can you learn too?
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
387 ---> b) Violets are blue,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
388 ---> c) Intelligence is learned,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
389 ---> a) Roses are red,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 Lesson 3.2: THE REPLACE COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
397 ** Type rx to replace the character at the cursor with x . **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 1. Move the cursor to the first line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 2. Move the cursor so that it is on top of the first error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
403 3. Type r and then the character which should be there.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
405 4. Repeat steps 2 and 3 until the first line is equal to the second one.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 ---> Whan this lime was tuoed in, someone presswd some wrojg keys!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 ---> When this line was typed in, someone pressed some wrong keys!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
410 5. Now move on to lesson 3.3.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
412 NOTE: Remember that you should be learning by doing, not memorization.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
417 Lesson 3.3: THE CHANGE OPERATOR
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
420 ** To change until the end of a word, type ce . **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 1. Move the cursor to the first line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
424 2. Place the cursor on the u in lubw.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
426 3. Type ce and the correct word (in this case, type ine ).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
428 4. Press <ESC> and move to the next character that needs to be changed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 5. Repeat steps 3 and 4 until the first sentence is the same as the second.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
432 ---> This lubw has a few wptfd that mrrf changing usf the change operator.
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
433 ---> This line has a few words that need changing using the change operator.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
435 Notice that ce deletes the word and places you in Insert mode.
22958
e7c125224b1a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22171
diff changeset
436 cc does the same for the whole line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 Lesson 3.4: MORE CHANGES USING c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
443 ** The change operator is used with the same motions as delete. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
445 1. The change operator works in the same way as delete. The format is:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
447 c [number] motion
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
449 2. The motions are the same, such as w (word) and $ (end of line).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
14347
723487cd7876 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14249
diff changeset
451 3. Move the cursor to the first line below marked --->.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 4. Move the cursor to the first error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
455 5. Type c$ and type the rest of the line like the second and press <ESC>.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 ---> The end of this line needs some help to make it like the second.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 ---> The end of this line needs to be corrected using the c$ command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
460 NOTE: You can use the Backspace key to correct mistakes while typing.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
463 Lesson 3 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
466 1. To put back text that has just been deleted, type p . This puts the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 deleted text AFTER the cursor (if a line was deleted it will go on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 line below the cursor).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 2. To replace the character under the cursor, type r and then the
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
471 character you want to have there.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
473 3. The change operator allows you to change from the cursor to where the
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
474 motion takes you. eg. Type ce to change from the cursor to the end of
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
475 the word, c$ to change to the end of a line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 4. The format for change is:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
479 c [number] motion
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 Now go on to the next lesson.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
486 Lesson 4.1: CURSOR LOCATION AND FILE STATUS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
488 ** Type CTRL-G to show your location in the file and the file status.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
489 Type G to move to a line in the file. **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
491 NOTE: Read this entire lesson before executing any of the steps!!
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
493 1. Hold down the Ctrl key and press g . We call this CTRL-G.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
494 A message will appear at the bottom of the page with the filename and the
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
495 position in the file. Remember the line number for Step 3.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
497 NOTE: You may see the cursor position in the lower right corner of the screen
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
498 This happens when the 'ruler' option is set (see :help 'ruler' )
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
500 2. Press G to move you to the bottom of the file.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
501 Type gg to move you to the start of the file.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
502
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
503 3. Type the number of the line you were on and then G . This will
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
504 return you to the line you were on when you first pressed CTRL-G.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 4. If you feel confident to do this, execute steps 1 through 3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 Lesson 4.2: THE SEARCH COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 ** Type / followed by a phrase to search for the phrase. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 1. In Normal mode type the / character. Notice that it and the cursor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 appear at the bottom of the screen as with the : command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 2. Now type 'errroor' <ENTER>. This is the word you want to search for.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 3. To search for the same phrase again, simply type n .
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
520 To search for the same phrase in the opposite direction, type N .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
522 4. To search for a phrase in the backward direction, use ? instead of / .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
524 5. To go back to where you came from press CTRL-O (Keep Ctrl down while
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
525 pressing the letter o). Repeat to go back further. CTRL-I goes forward.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
527 ---> "errroor" is not the way to spell error; errroor is an error.
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
528 NOTE: When the search reaches the end of the file it will continue at the
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
529 start, unless the 'wrapscan' option has been reset.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 Lesson 4.3: MATCHING PARENTHESES SEARCH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 ** Type % to find a matching ),], or } . **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 1. Place the cursor on any (, [, or { in the line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 2. Now type the % character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
541 3. The cursor will move to the matching parenthesis or bracket.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
543 4. Type % to move the cursor to the other matching bracket.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
544
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
545 5. Move the cursor to another (,),[,],{ or } and see what % does.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 ---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
549
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
550 NOTE: This is very useful in debugging a program with unmatched parentheses!
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
555 Lesson 4.4: THE SUBSTITUTE COMMAND
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 ** Type :s/old/new/g to substitute 'new' for 'old'. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 1. Move the cursor to the line below marked --->.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
562 2. Type :s/thee/the <ENTER> . Note that this command only changes the
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
563 first occurrence of "thee" in the line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
565 3. Now type :s/thee/the/g . Adding the g flag means to substitute
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
566 globally in the line, change all occurrences of "thee" in the line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 ---> thee best time to see thee flowers is in thee spring.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 4. To change every occurrence of a character string between two lines,
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
571 type :#,#s/old/new/g where #,# are the line numbers of the range
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
572 of lines where the substitution is to be done.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
573 Type :%s/old/new/g to change every occurrence in the whole file.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
574 Type :%s/old/new/gc to find every occurrence in the whole file,
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
575 with a prompt whether to substitute or not.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
578 Lesson 4 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
581 1. CTRL-G displays your location in the file and the file status.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
582 G moves to the end of the file.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
583 number G moves to that line number.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
584 gg moves to the first line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 2. Typing / followed by a phrase searches FORWARD for the phrase.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 Typing ? followed by a phrase searches BACKWARD for the phrase.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 After a search type n to find the next occurrence in the same direction
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
589 or N to search in the opposite direction.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
590 CTRL-O takes you back to older positions, CTRL-I to newer positions.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
592 3. Typing % while the cursor is on a (,),[,],{, or } goes to its match.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
594 4. To substitute new for the first old in a line type :s/old/new
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 To substitute new for all 'old's on a line type :s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 To substitute phrases between two line #'s type :#,#s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 To substitute all occurrences in the file type :%s/old/new/g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 To ask for confirmation each time add 'c' :%s/old/new/gc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 Lesson 5.1: HOW TO EXECUTE AN EXTERNAL COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 ** Type :! followed by an external command to execute that command. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606 1. Type the familiar command : to set the cursor at the bottom of the
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
607 screen. This allows you to enter a command-line command.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 2. Now type the ! (exclamation point) character. This allows you to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 execute any external shell command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 3. As an example type ls following the ! and then hit <ENTER>. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 will show you a listing of your directory, just as if you were at the
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
614 shell prompt. Or use :!dir if ls doesn't work.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
616 NOTE: It is possible to execute any external command this way, also with
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
617 arguments.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
619 NOTE: All : commands must be finished by hitting <ENTER>
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
620 From here on we will not always mention it.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 Lesson 5.2: MORE ON WRITING FILES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
627 ** To save the changes made to the text, type :w FILENAME **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 1. Type :!dir or :!ls to get a listing of your directory.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 You already know you must hit <ENTER> after this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 2. Choose a filename that does not exist yet, such as TEST.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 3. Now type: :w TEST (where TEST is the filename you chose.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
636 4. This saves the whole file (the Vim Tutor) under the name TEST.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
637 To verify this, type :!dir or :!ls again to see your directory.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
639 NOTE: If you were to exit Vim and start it again with vim TEST , the file
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 would be an exact copy of the tutor when you saved it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
642 5. Now remove the file by typing (Windows): :!del TEST
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 or (Unix): :!rm TEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
647 Lesson 5.3: SELECTING TEXT TO WRITE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
650 ** To save part of the file, type v motion :w FILENAME **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
651
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
652 1. Move the cursor to this line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
654 2. Press v and move the cursor to the fifth item below. Notice that the
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
655 text is highlighted.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
657 3. Press the : character. At the bottom of the screen :'<,'> will appear.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
659 4. Type w TEST , where TEST is a filename that does not exist yet. Verify
2421
c0e675a3e363 Minor runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
660 that you see :'<,'>w TEST before you press <ENTER>.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661
3847
1003f9b262d7 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
662 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
663 to see it. Do not remove it yet! We will use it in the next lesson.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
665 NOTE: Pressing v starts Visual selection. You can move the cursor around
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
666 to make the selection bigger or smaller. Then you can use an operator
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
667 to do something with the text. For example, d deletes the text.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 Lesson 5.4: RETRIEVING AND MERGING FILES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
673 ** To insert the contents of a file, type :r FILENAME **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
675 1. Place the cursor just above this line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
677 NOTE: After executing Step 2 you will see text from lesson 5.3. Then move
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
678 DOWN to see this lesson again.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
680 2. Now retrieve your TEST file using the command :r TEST where TEST is
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
681 the name of the file you used.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
682 The file you retrieve is placed below the cursor line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
684 3. To verify that a file was retrieved, cursor back and notice that there
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
685 are now two copies of lesson 5.3, the original and the file version.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
687 NOTE: You can also read the output of an external command. For example,
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
688 :r !ls reads the output of the ls command and puts it below the
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
689 cursor.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
693 Lesson 5 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 1. :!command executes an external command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 Some useful examples are:
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
699 (Windows) (Unix)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 :!dir :!ls - shows a directory listing.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 :!del FILENAME :!rm FILENAME - removes file FILENAME.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 2. :w FILENAME writes the current Vim file to disk with name FILENAME.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
705 3. v motion :w FILENAME saves the Visually selected lines in file
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
706 FILENAME.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
708 4. :r FILENAME retrieves disk file FILENAME and puts it below the
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
709 cursor position.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
711 5. :r !dir reads the output of the dir command and puts it below the
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
712 cursor position.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 Lesson 6.1: THE OPEN COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 ** Type o to open a line below the cursor and place you in Insert mode. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
721 1. Move the cursor to the first line below marked --->.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
723 2. Type the lowercase letter o to open up a line BELOW the cursor and place
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
724 you in Insert mode.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
726 3. Now type some text and press <ESC> to exit Insert mode.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 ---> After typing o the cursor is placed on the open line in Insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 4. To open up a line ABOVE the cursor, simply type a capital O , rather
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 than a lowercase o. Try this on the line below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
733 ---> Open up a line above this by typing O while the cursor is on this line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 Lesson 6.2: THE APPEND COMMAND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 ** Type a to insert text AFTER the cursor. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743
14347
723487cd7876 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14249
diff changeset
744 1. Move the cursor to the start of the first line below marked --->.
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
745
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
746 2. Press e until the cursor is on the end of li .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
748 3. Type an a (lowercase) to append text AFTER the cursor.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
750 4. Complete the word like the line below it. Press <ESC> to exit Insert
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
751 mode.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
753 5. Use e to move to the next incomplete word and repeat steps 3 and 4.
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
754
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
755 ---> This li will allow you to pract appendi text to a line.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
756 ---> This line will allow you to practice appending text to a line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
758 NOTE: a, i and A all go to the same Insert mode, the only difference is where
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
759 the characters are inserted.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
762 Lesson 6.3: ANOTHER WAY TO REPLACE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 ** Type a capital R to replace more than one character. **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
767 1. Move the cursor to the first line below marked --->. Move the cursor to
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
768 the beginning of the first xxx .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
770 2. Now press R and type the number below it in the second line, so that it
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
771 replaces the xxx .
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
772
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
773 3. Press <ESC> to leave Replace mode. Notice that the rest of the line
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
774 remains unmodified.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
776 4. Repeat the steps to replace the remaining xxx.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
777
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
778 ---> Adding 123 to xxx gives you xxx.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
779 ---> Adding 123 to 456 gives you 579.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
781 NOTE: Replace mode is like Insert mode, but every typed character deletes an
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
782 existing character.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
784 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
785 Lesson 6.4: COPY AND PASTE TEXT
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
788 ** Use the y operator to copy text and p to paste it **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
790 1. Move to the line below marked ---> and place the cursor after "a)".
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
791
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
792 2. Start Visual mode with v and move the cursor to just before "first".
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
793
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
794 3. Type y to yank (copy) the highlighted text.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
796 4. Move the cursor to the end of the next line: j$
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
798 5. Type p to put (paste) the text. Then type: a second <ESC> .
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
799
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
800 6. Use Visual mode to select " item.", yank it with y , move to the end of
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
801 the next line with j$ and put the text there with p .
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
802
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
803 ---> a) this is the first item.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
804 b)
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
805
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19968
diff changeset
806 NOTE: You can also use y as an operator: yw yanks one word,
22958
e7c125224b1a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22171
diff changeset
807 yy yanks the whole line, then p puts that line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
809 Lesson 6.5: SET OPTION
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
810
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 ** Set an option so a search or substitute ignores case **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
814 1. Search for 'ignore' by entering: /ignore <ENTER>
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
815 Repeat several times by pressing n .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
817 2. Set the 'ic' (Ignore case) option by entering: :set ic
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
818
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
819 3. Now search for 'ignore' again by pressing n
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
820 Notice that Ignore and IGNORE are now also found.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
822 4. Set the 'hlsearch' and 'incsearch' options: :set hls is
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
824 5. Now type the search command again and see what happens: /ignore <ENTER>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
826 6. To disable ignoring case enter: :set noic
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
828 NOTE: To remove the highlighting of matches enter: :nohlsearch
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
829 NOTE: If you want to ignore case for just one search command, use \c
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
830 in the phrase: /ignore\c <ENTER>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
832 Lesson 6 SUMMARY
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
834 1. Type o to open a line BELOW the cursor and start Insert mode.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
835 Type O to open a line ABOVE the cursor.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
837 2. Type a to insert text AFTER the cursor.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
838 Type A to insert text after the end of the line.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
840 3. The e command moves to the end of a word.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
841
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
842 4. The y operator yanks (copies) text, p puts (pastes) it.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
844 5. Typing a capital R enters Replace mode until <ESC> is pressed.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
846 6. Typing ":set xxx" sets the option "xxx". Some options are:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
847 'ic' 'ignorecase' ignore upper/lower case when searching
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
848 'is' 'incsearch' show partial matches for a search phrase
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
849 'hls' 'hlsearch' highlight all matching phrases
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
850 You can either use the long or the short option name.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
852 7. Prepend "no" to switch an option off: :set noic
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
855 Lesson 7.1: GETTING HELP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 ** Use the on-line help system **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 Vim has a comprehensive on-line help system. To get started, try one of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861 these three:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 - press the <HELP> key (if you have one)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 - press the <F1> key (if you have one)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864 - type :help <ENTER>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
866 Read the text in the help window to find out how the help works.
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
867 Type CTRL-W CTRL-W to jump from one window to another.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
868 Type :q <ENTER> to close the help window.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870 You can find help on just about any subject, by giving an argument to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871 ":help" command. Try these (don't forget pressing <ENTER>):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
872
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
873 :help w
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
874 :help c_CTRL-D
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
875 :help insert-index
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
876 :help user-manual
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
877 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
878 Lesson 7.2: CREATE A STARTUP SCRIPT
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
879
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
880
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
881 ** Enable Vim features **
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
883 Vim has many more features than Vi, but most of them are disabled by
24751
e69e7133c9cf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22958
diff changeset
884 default. To start using more features you should create a "vimrc" file.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
886 1. Start editing the "vimrc" file. This depends on your system:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
887 :e ~/.vimrc for Unix
24751
e69e7133c9cf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22958
diff changeset
888 :e ~/_vimrc for Windows
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
889
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
890 2. Now read the example "vimrc" file contents:
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
891 :r $VIMRUNTIME/vimrc_example.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
892
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
893 3. Write the file with:
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
894 :w
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
895
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
896 The next time you start Vim it will use syntax highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
897 You can add all your preferred settings to this "vimrc" file.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
898 For more information type :help vimrc-intro
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
899
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
900 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
901 Lesson 7.3: COMPLETION
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
902
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
903
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
904 ** Command line completion with CTRL-D and <TAB> **
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
905
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
906 1. Make sure Vim is not in compatible mode: :set nocp
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
907
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
908 2. Look what files exist in the directory: :!ls or :!dir
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
909
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
910 3. Type the start of a command: :e
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
911
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
912 4. Press CTRL-D and Vim will show a list of commands that start with "e".
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
913
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
914 5. Type d<TAB> and Vim will complete the command name to ":edit".
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
915
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
916 6. Now add a space and the start of an existing file name: :edit FIL
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
917
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
918 7. Press <TAB>. Vim will complete the name (if it is unique).
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
919
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
920 NOTE: Completion works for many commands. Just try pressing CTRL-D and
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
921 <TAB>. It is especially useful for :help .
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
922
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
923 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 11
diff changeset
924 Lesson 7 SUMMARY
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
925
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
926
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
927 1. Type :help or press <F1> or <HELP> to open a help window.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
928
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
929 2. Type :help cmd to find help on cmd .
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
930
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
931 3. Type CTRL-W CTRL-W to jump to another window.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
932
14249
4543777545a3 Updated runtime and language files.
Christian Brabandt <cb@256bit.org>
parents: 13231
diff changeset
933 4. Type :q to close the help window.
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
934
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
935 5. Create a vimrc startup script to keep your preferred settings.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
936
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
937 6. When typing a : command, press CTRL-D to see possible completions.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
938 Press <TAB> to use one completion.
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
939
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
940
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
941
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
942
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
943
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
944
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948 This concludes the Vim Tutor. It was intended to give a brief overview of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 the Vim editor, just enough to allow you to use the editor fairly easily.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 It is far from complete as Vim has many many more commands. Read the user
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951 manual next: ":help user-manual".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
952
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953 For further reading and studying, this book is recommended:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
954 Vim - Vi Improved - by Steve Oualline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
955 Publisher: New Riders
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
956 The first book completely dedicated to Vim. Especially useful for beginners.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
957 There are many examples and pictures.
27623
179c118424a6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
958 See https://iccf-holland.org/click5.html
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
959
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
960 This book is older and more about Vi than Vim, but also recommended:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
961 Learning the Vi Editor - by Linda Lamb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
962 Publisher: O'Reilly & Associates Inc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
963 It is a good book to get to know almost anything you want to do with Vi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
964 The sixth edition also includes information on Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
965
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
966 This tutorial was written by Michael C. Pierce and Robert K. Ware,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
967 Colorado School of Mines using ideas supplied by Charles Smith,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
968 Colorado State University. E-mail: bware@mines.colorado.edu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
969
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
970 Modified for Vim by Bram Moolenaar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
971
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
972 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~