pdf VI Shortcuts
Par keyphrene, Friday 26 June 2009 à 11:58 :: Shell Unix :: #20 :: rss
This reference guide to the vi editor presents the majority of vi commands and keys
Save - Exit - Reload
ESC:w Save ESC:w /path/to/filename Save in ESC:wq, ESC:x, ZZ Save and Exit ESC:q Exit without save ESC:q! Force exit without save ESC:e Reload
Cursor move
gg Begin of File Shift+g End of file ESC+b Begin of word ESC+e End of word ESC+0 Begin of the line ESC+$ End of the line ESC:<line> Goto Ctrl+f Page down Ctrl+b Page up ESC+>> Add a tabulation ESC+<< Remove a tabulation
Insert
ESC+i Insert before cursor ESC+a Insert after cursor ESC+I Insert at the beginning of line ESC+A Insert at the ending of line ESC+O Insert one line before ESC+o Insert one line after
Remove
ESC+x Remove a char ESC+dw Remove a word (put in the clipboard) ESC+dd Remove a line under cursor (put in the clipboard) ESC+D Remove the line
Copy - Move
ESC+yw Word copy (Ctrl-c) ESC+yy Line copy ESC+dw Word remove (put in the clipboard) (Ctrl-x) ESC+dd Line remove under cursor (put in the clipboard) ESC+p Copy after cursor (Ctrl-v) ESC+P Copy before cursor (Ctrl-v)
Search
ESC+/+occurence Search word (descending) ESC+?+occurence Search word (ascing) n Next word N Previous word
Replace
ESC:%s/INFO/DEBUG/g
Options
ESC:set all Display all the list ESC:set Display active list ESC:set nu Display number of the line ESC:set no nu Remove number of the line

Comments
No comment for this moment.
Add a comment