tabs-vs-spaces.nvim
tabs-vs-spaces.nvim copied to clipboard
set command in which-key not work
I can use this plugin normally by manually running command.
But when I set cmd on which-key plugin, it only can convert the current buffer all indent, can not use for range and still in visual mode.
Kooha-2023-08-11-01-31-21.webm
wk.register({
...
...
i = {
name = "indent",
t = { "<cmd>TabsVsSpacesConvert spaces_to_tabs<cr>" , "space to tab"},
s = { "<cmd>TabsVsSpacesConvert tabs_to_spaces<cr>" , "tab to space"},
},
}, {
prefix = "<leader>",
mode = {"n", "v"}
})
but follow command in which key can work:
wk.register({
...
...
i = {
name = "indent",
t = { "<cmd>'<,'>TabsVsSpacesConvert spaces_to_tabs<cr>" , "space to tab"},
s = { "<cmd>'<,'>TabsVsSpacesConvert tabs_to_spaces<cr>" , "tab to space"},
}, {
prefix = "<leader>",
mode = {"n", "v"}
})
it should be worked in the first method (I think it should be).