vim - Repeat a Command invoked from Menu -


I have created several menu commands in VIM.

. Repeats repeat the final command repeats the command line

Can the last command applied to the menu of the Vim be repeated? ?

Update:

Example menu command:

  one 98.80.00 and MyMenu.Test \: call & lt ; Sid & gt; Test ("%") & lt; CR & gt;   

If I use this menu command created by myself, then how can I repeat it (repeat the last used menu command)? In the case of the above it will be : call & lt; SID & gt; Test ("%") & lt; CR & gt;
I can not find these commands in command line history.
@: and : & lt; UP & gt; does not work

Do anyone know how the Vime function protects calls / menu command actions?

Update2

Kent proposed to create a function around the above command:

  one 98.80.00 and MyMenu. Test \: Call SubExe ('call & lt; sid & gt; Test ("%")') & lt; CR & gt; Function! It all starts to work, the disadvantage is that I have to change all the existing commands;)        

If there is no built-in support, then you have to create one yourself, if it is very important for you. The basic idea is:

You create a function, such as ExecMenuCmd (cmd) is the logic command, such as wq , in the function, you save Command in a variable, then execute it.

Then you can create a mapping to "repeat" the last menu cmd by reading and executing the variable.

When you create menu items, you do something like this:

 : menu file. Save and Exec: Call ExecMenuCmd ('wq')   

If you want, you can maintain a stack to store, triggered by the menu to implement more features Ordered order

Comments