Closed juanMarinero closed 4 years ago
You can enable and disable at a buffer level using a bang, for example
IlluminateDisable!
IlluminateEnable!
IlluminateToggle!
Without the bang will apply globally (however, any previously used bang calls will override all future global invocations).
I'm going to leave this undocumented for a bit so it can be tested.
Thanks @RRethy !! It works.
Might someone just copy-paste:
nnoremap <buffer> <leader>aht <Esc>:IlluminationToggle!<CR>:echo "---- Auto highlight wordUnderCursor toogled BUFFER (add g to map global)----"<CR>
nnoremap <leader>ahtg <Esc>:IlluminationToggle<CR>:echo "---- Auto highlight wordUnderCursor toogled GLOBALLY (all buffers) ----"<CR>
In the mapping you don't need <buffer>
since that just means "make this mapping only for this buffer", it doesn't modify the functionality of the executed command.
How can I apply
IlluminationToggle
just in current buffer? Please. From the doc - COMMANDS section, I tried in vain to map either globally OR buffer-range:Since the toggle function is (source)
...I tried to build my own mini function, but these also affect all buffers:
Thanks in advance!