vim-repeat icon indicating copy to clipboard operation
vim-repeat copied to clipboard

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

Open mahaaaham opened this issue 2 years ago • 1 comments

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!

mahaaaham avatar Oct 15 '23 07:10 mahaaaham

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

wookayin avatar Nov 26 '23 22:11 wookayin