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?

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top