Vi For Smarties

Lesson Six


Useful Movement Shortcuts

  1. 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.
  2. Use fc to move forward to the next occurrence of the letter c on the current line. Replace the c with any character desired.
  3. Use Fc to move backward to the next occurrence of the letter c on the current line. Replace the c with any character desired.
  4. Use ; (semicolon) to repeat the last f or F search and , (comma) to repeat it in the opposite direction.
  5. Use ) to move forward one sentence. Use ( to move backward one sentence.
  6. Use } to move forward one paragraph. Use { to move backward one paragraph.
  7. 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

  1. Use I to Insert text at the beginning of the current line. Use A to Append text to the end of the current line.
  2. Use D to Delete the rest of the line starting from the cursor position.
  3. 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.
  4. 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.
  5. 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.
  6. 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.