h,j,k,l — move left, down, up, right
{,} — go to previous/next paragraph (where the previous/next blank line is}
% — go to matching brace/parens
gg — start of file
G — end of file
z. — to put the line with the cursor at the center,
zt — to put the line with the cursor at the top
zb — to put the line with the cursor at the bottom of the screen.
H — go to top of window
M — middle of window
L — bottom of window
While in Visual mode, you can use :
to run commands only on the current selection. Super handy for e.g. doing a search and replace on the current selection.
Essential to get some stuff done and easily do multiline edits for example, or replace text within the selection.
v - enter visual mode
V - enter line visual mode (selects entire lines instead of starting at the cursor)
Ctrl+V - enter block visual mode (select the same length over multiple lines)
Very useful to move around in the same file
mk - mark current position (can use a-z-A-Z, upper case works between files)
'k - move to mark k
d'k - delete from current position to mark k
'a-z - same file
'A-Z - beteween files
Creating:
:tabedit {file} edit specified file in a new tab
:tabfind {file} open a new tab with filename given, searching the 'path' to find it
Or with Ctrl+P open, use Ctrl+t
Navigation:
gt go to next tab
gT go to previous tab
{i}gt go to tab in position i
Split window horizontally/vertically. Also useful for navigation in plugins like NERDTree.
Ctrl+w s Split horizontally
Ctrl+w v Split vertically
Ctrl+w w Switch between windows
:so $MYVIMRC Reload .vimrc
gx Open URL under cursor in browser
Cltr+R " Paste contents of register in command mode
:normal . Repeat last command on each line of the current visual selection
[I Find all instances of what's under cursor in current folder