h
←l
→k
↑j
↓0
Go to the first character of the line^
Go to the first non-blank charater of the line$
Go to the end of the linegg
Go to the first lineG
Go to the last line
:ls
List buffers:e
Reload current bufffer:bd!|e [file]
Openfile
in current buffer:N,Mbd
Delete buffers fromN
toM
:q
Quit the current window:q!
Quit the current window, discard any changes:clo
Close the current window, unless it is the last one:on
Make the current window the only oneCtrl-W s
Create a horizontal splitCtrl-W v
Create a vertical splitCtrl-W h
Go to left windowCtrl-W l
Go to right windowCtrl-W k
Go to up windowCtrl-W j
Go to down window
z<CR>
orzt
Put current line to top of screen (<CR>
== Enter)z.
orzz
Put current line to center of screenz-
orzb
Put current line to bottom of screen
To search through command history, enter the prefix of your previous command and push <Up>.
To configure command history size
:set history=1000
zo
Open one foldzc
Close one foldzr
Reduce foldingzm
Fold morezR
Open all foldszM
Close all folds
[c
Jump to the previous conflict]c
Jump to the next conflict:diffg [bufspec]
Copy change from[bufspec]
the current buffer:diffp [bufspec]
Copy change from the current buffer to[bufspec]
:'<,'>diffg
:'<,'>diffp
Copy change in the selected region
Use the same config for both Vim and Neovim:
mkdir -p ~/.config/
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim