Vi For Smarties
Lesson Six
Useful Movement Shortcuts
- Use W E B (uppercase) to move forward one
space-delimited Word, forward to the next
End of a space-delimited word, and Back
one space-delimited word, respectively. This allows punctuation to be
counted as part of a word.
Example: 3dW deletes 3
space-delimited Words.
- Use fc to move forward to the next occurrence of
the letter c on the current line. Replace the
c with any character desired.
- Use Fc to move backward to the next
occurrence of the letter c on the current line. Replace
the c with any character desired.
- Use ; (semicolon) to repeat the last f
or F search and , (comma) to repeat it in
the opposite direction.
- Use ) to move forward one sentence. Use
( to move backward one sentence.
- Use } to move forward one paragraph. Use
{ to move backward one paragraph.
- Use H M L to move to the Highest
line on the screen, the Middle line of the screen, and
the Lowest line on the screen, respectively.
Useful Editing Shortcuts
- Use I to Insert text at the
beginning of the current line. Use A to
Append text to the end of the current line.
- Use D to Delete the rest of the line
starting from the cursor position.
- Use C (uppercase) to Change the rest
of the line starting from the cursor position. This deletes the rest of
the line starting from the cursor position and places you in insert
mode.
- Use c (lowercase) to change text objects. This
deletes the indicated object and places you in insert mode.
Example: cw deletes the current word and places you in
insert mode.
Example: cc deletes the current line and places you in
insert mode.
- Use r to replace the character under
the cursor with the next character typed.
Example: rc will replace the character
under the cursor with the character c and leave you in
command mode.
- Use R to begin overwriting text starting from the
cursor position. Hit Esc when done to return to command
mode.
Until you have mastered everything on this page, you are
not ready for Lesson Seven.
Copyright © 2001
jerry_y_wang@yahoo.com.
All rights reserved.