Question

I am new to VIM and I use the command

qa

to start recording the operations in register a and the following command

q

to stop saving. And the following command to use the operations in a:

@a

But the problem is that, when I close the VIM, all these registers are deleted. Is there any way to save these operations and use it later in other sessions of VIM?

Was it helpful?

Solution

If you don't run Vim in compatible mode (only masochists would run Vim in compatible mode), named registers, "a to "z, are remembered across sessions.

Do you run Vim without a ~/.vimrc? What is the output of :set viminfo? :set compatible? (with the question mark)?

OTHER TIPS

You could create a map in your .vimrc

map <F2> [your macro]

If the macro is already at register 'a', you can also use it, that is, instead of repeating [your macro], you can type <C-r>a while in insert mode.

You could also try marvim.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top