tpope / vim-repeat

repeat.vim: enable repeating supported plugin maps with "."
http://www.vim.org/scripts/script.php?script_id=2136
2.59k stars 81 forks source link

Repeating imap commands #21

Closed nilbus closed 10 years ago

nilbus commented 10 years ago

@tpope, I noticed that none of the plugins I've found that use vim-repeat successfully repeat imap commands. For example, your vim-surround plugin has

imap    <C-S> <Plug>Isurround

but Isurround does not call repeat#set. Indeed is not repeatable using ..

I'm hoping to be able to use vim-repeat to fix repeat behavior for https://github.com/jiangmiao/auto-pairs/issues/3, but using repeat#set in the suggested manner seemed to have no effect.

Should vim-repeat be able to support imap commands?

tpope commented 10 years ago

You'd have to call repeat#set with the entirety of the insertion, which I don't think is accessible. I think your best bet would be :undojoin, but it can be a bit fiddly.