VIM Commands
Vim Commands
Commands in NORMAL modes
Motions
small granular: move by direction
k
h l
j
mid granular: move by word
emove onto the end of the current wordbmove onto the head of the current wordwmove onto the head of the next word
large granular: move by line
$move onto the head char of the line0move onto the tail char of the line
huge granular: move by paragraph
{move onto the last blank line(move onto the begnning of this paragraph}&)move onto the next blank line
extreme granular: move by file
[line number]Gmove to the specific lineggmove to the first line of the fileGmove to the last line of the file
Operators
Operators make effects on the corpus when assigned to some range (defined by cursor movement or the object). Operator could be doubled to work on the current line
{Operator} + {Motions} OR {Object} = Operation
ddeletedawawfor a word(defined by space)dapapfor a whole paragraph(defined by blank line)yyank into registercchangeg~swap casegumake lowercasegUMake uppercase>shift right<shift right=auto indent!filter {Motion} lines through an external program
Undo Tasks
uundo one certain operation
(one editing command in normal mode, all editing in insert mode last time)Ctrl-rfor redo one task
Special Command g
Begin Editing
into INSERT mode
ibegin inserting at current positionabegin inserting at the next positionAbegin inserting at the end of the lineobegin inserting at the beginning of the new line belowObegin inserting at the beginning of the new line abovesdelete the current char & begin insertingSdelete the current line & begin inserting at the head of current lineCdelete the rest of current line & begin editing
local modification
rcharacter replacement (quit insert mode after one char modification)Ddelete the rest of the lineJcombine this line and the next
Copy and Paste
- 删除的文本将储存在寄存器中
- p 将寄存器的内容放在光标下方的行
f{char} find the next occurence of {char}
; repeat the last search operation
Command in INSERT modes
Delete in insert mode
Ctrl-hBackspaceCtrl-wdelect back one wordCtrl-udelect back to start of line
浙公网安备 33010602011771号