Closed krzkrzkrz closed 1 year ago
Ah, you can use :Hi+%
command for HiSetSL
function.
Hi, and what about for visual select mode?
I was thinking vim.keymap.set('v', 'tw', ':Hi+x<CR>')
and vim.keymap.set('v', 'tw', ':Hi+x%<CR>')
? Or am I missing something?
You can use the same key for both normal and visual modes.
So, how about assigning tt
to both :Hi+
and :Hi+x
commands,
and tw
to :Hi+%
and :Hi+x%
?
Here 'x' means visual mode.
Hmmmm that works, maybe I did not explain well. I want to highlight part of a word/selection in visual mode
I'm glad it's working now. May I ask a question that in which cases you would prefer direct mapping instead of using predefined variables? Wouldn't it be simpler to assign keys to predefined variables something like vim.g.HiSet = 'tt'
Ahh, that works better actually. Thank you for pointing that out. Let me close the issue for now
I might have missed reading something in the help file.
But if
vim.keymap.set('n', 'tt', ':Hi+<CR>')
allows me to highlight a set (the equivalent ofHiSet)
How do I set a keymap for
HiSetSL
?Similarly, how do you programmatically set keymaps for
HiSet
andHiSetSL
in visual select mode?