Sie sind auf Seite 1von 1

Movement Inserting Text

hjkl Left, down, up, right i Insert at cursor


^ Go to the beginning of the line I Insert at the beginning of the line
$ Go to the end of the line a Append after cursor
gg Go to the first line A Append at the end of the line
G Go to the last line o Open a new line below the current line
:n Go to line n O Open a new line above the current line

Replacing Text Deleting Text


r Replace character x Delete character
cw Change word dd Delete line
cc Change line dw Delete word
c{motion} Change from cursor to {motion} d{motion} Delete {motion}

Copy/Paste Undo/Redo
y{motion} Yank {motion} u Undo
yy Yank line Ctrl-r Redo
p Paste after cursor
P Paste before cursor Save and Quit
:w Write (save)
Searching :wq Write and quit
/{pattern} Forward search for {pattern} :q Quit
?{pattern} Reverse search for {pattern} :q ! Force quit, don’t save changes
n Repeat the last search :wq! Force write and quit
N Repeat the last search in the opposite direction

Repeating Commands Help


{num}{command} Repeat command {num} times :help [topic/command] Get help on topic or command.
. Repeat previous change vimtutor Tutorial

Find and Replace


:s/{old}/{new}/{options} Substitute {new} for {old} on the current line
:%s/{old}/{new}/{options} Substitute {new} for {old} in the entire document
The g option substitutes all occurrences on a line, otherwise just the first occurrence is changed per line.

http://www.LinuxTrainingAcademy.com

Das könnte Ihnen auch gefallen