You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By reading the README it was not clear to me how to use this plugin. Using this screencast (http://vimcasts.org/episodes/creating-repeatable-mappings-with-repeat-vim/) I managed to figure out how it works. Here is a concrete example, I think it would be a good idea to add it (or something similar) to the README:
I agree with jabbalaci. It's not at all clear how to use this plugin. I thought you could execute a plugin command, move to another position in your file, hit ".", and the command would repeat itself. Clearly that's not the case as you still need to create a custom mapping for this to work.
Reacted by Vlad GURDIGA, grepsuzette, Subhaditya Nath, Luiz Henrique Oliveira Martins, max, Jason Gomez, steveb-123, Goli4thus and NewComer00
I also agree with the above. Just tried to integration vim-repeat with my own plugin (still unreleased) and stuggled quite a bit.
Neither by looking at the official help page or README, nor by looking at the developer comments in vim-repeat source code, nor by looking at other plugins like vim-surround or nerdcommenter did it really make click for me.
Only after stumbling over this discussion and seeing the example by @jabbalaci did it make more sense. With some trial and error after that I finally got it working for my own case.
But yeah, having a couple simple examples would make adoption more doable.
Here's my gist of what I've learned today:
Let's say originally we had a mapping like this one:
This example makes use of the second variable being -1, which ignores any count prefixes to the mapping call.
In a sense it's about introducing <Plug>MyPluginMap, which is like a placeholder and is being used in the repeat#set() call.
Furthermore the actual mapping then is made referencing this placeholder.
Activity
robertf57 commentedon May 27, 2016
I agree with jabbalaci. It's not at all clear how to use this plugin. I thought you could execute a plugin command, move to another position in your file, hit ".", and the command would repeat itself. Clearly that's not the case as you still need to create a custom mapping for this to work.
Goli4thus commentedon Mar 2, 2023
I also agree with the above. Just tried to integration
vim-repeatwith my own plugin (still unreleased) and stuggled quite a bit.Neither by looking at the official help page or README, nor by looking at the developer comments in
vim-repeatsource code, nor by looking at other plugins likevim-surroundornerdcommenterdid it really make click for me.Only after stumbling over this discussion and seeing the example by @jabbalaci did it make more sense. With some trial and error after that I finally got it working for my own case.
But yeah, having a couple simple examples would make adoption more doable.
Here's my gist of what I've learned today:
Let's say originally we had a mapping like this one:
Adding
vim-repeat:This example makes use of the second variable being
-1, which ignores any count prefixes to the mapping call.In a sense it's about introducing
<Plug>MyPluginMap, which is like a placeholder and is being used in therepeat#set()call.Furthermore the actual mapping then is made referencing this placeholder.