Vim is an editor with a steep learning curve. This is a list of shortcuts that I have learnt and use regularly. It is by no means intended to be a comprehensive list and will continue to grow as I learn more.
hjkl- left, down, up, right
:vs- visual split create a new vertical window
:Vex- visual split create a new vertical window in netrw mode
:Vex!adds to RHS
:Ex- enter netrw
ctrl + w + w- toggle between windows
gg- to start of file
G- to end of file
0- to start of line
$- to end of line
b- to beginning of word
w- to beginning of next word
ctrl n- go down in list, turns out this works on various other software e.g. Chrome + Sublime autocomplete
ctrl p- go down in list, turns out this works on various other software like Chrome + Sublime autocomplete
:ls- list all listed buffers
:bn- next buffer
:bd- delete buffer
:b- switch to certain buffer, can tab for autocompletion, can search too. Or use a number from
ctrl d- move down half a screen
ctrl u- move up half a screen
vib- select in brackets (much more ergonomic than
dib- delete in brackets (much more ergonomic than
HML- high, middle, low, move cursor to this position of the screen to prevent hitting
V- select by whole lines
v- select text
gd- Go to definition
ctrl t- Go back a defintion (pop the ‘go to’ off the stack)
:FZF- search for file. Select a file in the list to open in new buffer
- Graphical cheat sheet - 2006 so dated but looks comprehensive and is often referenced.
- Devhints cheat sheet - this website has a bunch of great software engineering cheatsheets and cuts throught the rubbish.
You may find my .vimrc settings file here: https://github.com/oliverbenns/dotfiles/blob/master/.vimrc.
Plugins are installed in the setup script of that dotfiles repository.