I have created several menu commands in VIM.
Can the last command applied to the menu of the Vim be repeated? ? Update: Example menu command: 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 Do anyone know how the Vime function protects calls / menu command actions? Update2 Kent proposed to create a function around the above command: 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 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: If you want, you can maintain a stack to store, triggered by the menu to implement more features Ordered order . Repeats repeat the final command repeats the command line
one 98.80.00 and MyMenu.Test \: call & lt ; Sid & gt; Test ("%") & lt; CR & gt;
: 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
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;)
ExecMenuCmd (cmd) is the logic command, such as
wq , in the function, you save Command in a variable, then execute it.
: menu file. Save and Exec: Call ExecMenuCmd ('wq')
Comments
Post a Comment