Vim Tips
General Tips
vim -p file1 file2to open multiple files as tabs:qato quit out of all open buffers:Exto return to netrw (file explorer)
Terminals
:termto open a terminal in current window- Use
ito enter insert mode and type into the shell <C-\><C-n>to return to normal mode to allow scrolling or switching windows- I’ve remapped this to
<C-space>
- I’ve remapped this to
Windows
<C-w>prefixes all window commands<C-w>+h,j,k,lto focus window to left, bottom, up, right, respectively<C-w>sto split current window horizontally, equivalent to:split<C-w>vto split current window vertically, equivalent to:vs
Registers
"cbefore a command, wherecis the register to store the text- Use capital letter to append to the register, e.g.
"C
Macros
- Press
qcto start recording, wherecis the register to store the macro - Stop recording with
q - Replay the macro with
@c
Tags: