Vim
Types of mode
- insert mode
- replace mode
- visual mode
- visual line
- visual block
- command line mode
Starts with normal mode
Normal mode -> insert mode : press i
Normal mode -> replace mode : press r
Normal mode -> visual mode : press v
Normal mode -> visual mode : press shift +v
Normal mode -> visual mode : press ctrl +v
Normal mode -> command line mode : press :
any mode -> normal mode : <esc>
normal mode
movement keys
h
: leftj
: downk
: upl
: rightw
: move forward by one wordb
: move backward by one worde
: end of the word0
: beginning of the line$
: end of the line^
: non first empty character line^U
: move up^D
: move downG
: move all the way down (case sensitive)gg
: move all the way up (case sensitive)L
: Lowest line on screen (case sensitive)M
: Middle line on screen (case sensitive)H
: Highest line on screen (case sensitive)f<char>
: jump forward to the first occurance of<char>
(case sensitive)F<char>
: jump backward to the first occurance of<char>
(case sensitive)t<char>
: jump forward to<char>
just before it. (case sensitive)T<char>
: jump backward to<char>
just before it. (case sensitive)
editing
x
: deleteo
: Creates new line just below the current line and changes to insert mode (case sensitive)O
: Creates new line just above the current line and changes to insert mode (case sensitive)/
: searcha
: append.
: repeat previous taksd<movement key>
: delete a char in the direction of<movement key>
c<movement key>
: replace a char in the direction of<movement key>
dd
: deletes the whole linecc
: deletes the whole line and puts to edit modeu
: undo^r
: redoy
: copypaste
:~
: change casedi(
ordi
[`: delete inside paranthesisci(
orci
[`: change inside paranthesis
repeating commands
<num><command>
: the<command>
will be done<num>
time(s)
insert mode
replace mode
visual mode
movement keys
h
: leftj
: downk
: upl
: rightw
: move forward by one wordb
: move backward by one worde
: end of the word0
: beginning of the line$
: end of the line^
: non first empty character line^U
: move up^D
: move downG
: move all the way down (case sensitive)gg
: move all the way up (case sensitive)L
: Lowest line on screen (case sensitive)M
: Middle line on screen (case sensitive)H
: Highest line on screen (case sensitive)f<char>
: jump forward to the first occurance of<char>
(case sensitive)F<char>
: jump backward to the first occurance of<char>
(case sensitive)t<char>
: jump forward to<char>
just before it. (case sensitive)T<char>
: jump backward to<char>
just before it. (case sensitive)
command line mode
quit
,q
: quitw
: write- `help : help for