سؤال

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