Vim
Some useful things:
- To paste a register into the command area, do
CTRL-R
and then the register name.
- This equally works when you’re in insert mode (handy for when you don’t want to enter normal mode just to paste something)
- Useful registers:
- The default register when you yank is named
"
- Current file path is in register named
%
- Last search expression is in register named
/
- To copy registers from one to another (e.g. to copy the name of the file from one buffer and put it elsewhere):
:let @a=@b
- To run macros over a bunch of lines, use the
norm!
command; e.g. to run macro q
on a bunch of lines, select the lines in visual mode and hten do :norm! @q