Modifying Text | |
Change current word | cw or cW |
Change current line (cursor to end) | C |
Delete character (cursor forward) | x |
Delete character (before cursor) | X |
Delete word | dw or dW |
Delete line | dd |
Delete text to end of line | D |
Duplicate text | (use yank and put) |
Join current line with next line | J |
Move text | (use delete and put) |
Put buffer text after/below cursor | p |
Put buffer text before/above cursor | P |
Repeat last modification command | . |
Replace current character | r |
Replace text to end of line | R |
Substitute text for character | s |
Undo your previous command | u |
Transpose characters | xp |
Yank (copy) word to buffer | yw |
Yank (copy) current line to buffer | Y |
Making Corrections During Text Insertions | |
Overwrite last character | <DELETE> |
Overwrite last word | <CTRL/W> |
Ending Your Edit Session | |
Quit (no changes made) | :q |
Quit and save changes | ZZ or :wq |
Quit and discard changes | :q! |
Using Alternate ex Commands | |
Copy specified lines | :co or t |
Display number of each text line | :set nu |
Move lines after after specified line | :m |
Read file after specified line | :r file |
Review current editor | :set |
Review editor options | :set all |
Set new editor option | :set option |
Write changes to original file | :w |
Write changes to specified file | :w file |
Write (overwrites) to existing file | :w! file |
Load a second file | :e file |
Switch between files | :e# |