In the keybinding I see:
[code]
[/code]
I see that is supposed to repeat an action x number of times, but how do you invoke it? And where?
In the keybinding I see:
[code]
[/code]
I see that is supposed to repeat an action x number of times, but how do you invoke it? And where?
The specific example he uses will let you type any number, followed by hitting “q” twice, and will select that number of lines. Try writing “5qq” to see what it does.
The keybinding itself is built up of a regular expression to catch any number, followed by the binding “q,q”. The command to be executed gets passed $1 as a paramater, which is the number “caught” in the regular expression.
The idea is, if you want to bind any command to accept a number before it, just copy this line and change the command from “expandSelectionTo line” to whatever command you want performed.
Uncomment the binding and press any number of digits followed by qq in any buffer. That should do the trick.
Make sure to add some lines first and also, if I remember correctly, Jon has recently capped the length of keybindings at 16 chars (that shouldn’t be a problem ).
HTH