0

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?

orezvani
  • 3,015
  • 8
  • 37
  • 53

2 Answers2

3

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)?

romainl
  • 158,436
  • 18
  • 236
  • 264
0

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.

Rafael Barbosa
  • 920
  • 8
  • 17