tpope / vim-repeat

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

Using vim-repeat with nvim and plugin commands mapped throught lua #97

Closed mahaaaham closed 2 weeks ago

mahaaaham commented 9 months ago

Hi,

I first apology because this is not a technical issue but more an incomprehension of my part about the use of this plugin with lua commands. I tried to ask the question in stackoverflow before asking it here, but it had no success ( https://stackoverflow.com/questions/77223892/repeat-with-a-motion-plugin-command-mapped-in-lua-throught-keyset )

I use, un neovim, the plugin coc.nvim with the proposed default configuration that set (in a lua file) :

-- Use `[g` and `]g` to navigate diagnostics
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
keyset("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})

I want to make these motions repeteable with ".".

As said in the main page of your plugin, I could use the following command at the end of my map functions:

silent! call repeat#set("\<Plug>MyWonderfulMap", v:count)

But I have no idea how to actually put this line of code with the "keyset" command of the coc.nvim plugin.

Do you have an idea of how to do it?

Thanks for reading me!

wookayin commented 8 months ago

See https://github.com/tpope/vim-repeat/issues/92#issuecomment-1826910664