RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.16k stars 47 forks source link

[Feature Request] Support highlight twins of word under cursor #45

Closed kevinhwang91 closed 4 years ago

kevinhwang91 commented 4 years ago

I think it's very useful. Highlight the word in the current line with the bold or italic style is awesome.

RRethy commented 4 years ago

I'm not sure what you mean, can you elaborate? If this is about customizing the appearance of the highlighting we have g:Illuminate_hl_link which can be used as :

    let g:Illuminate_hl_link = 'hi illuminatedWord cterm=underline gui=underline'
kevinhwang91 commented 4 years ago

No, like this project. https://github.com/dominikduda/vim_current_word

RRethy commented 4 years ago

Is this to support different highlight group for matches of the word under the cursor?

kevinhwang91 commented 4 years ago

Yes.

RRethy commented 4 years ago

Interesting, yea that's doable. This line would need to be modified to have 2 calls to matchadd using the pattern on line 88 if the person has opted in for the different highlights. I'm open to PRs, if not when I'm free I'll implement it.

RRethy commented 4 years ago

You can use something like this to get the behaviour.

augroup illuminate_augroup
    autocmd!
    autocmd VimEnter * hi illuminatedWord cterm=italic gui=italic | hi illuminatedCurWord cterm=bold gui=bold
augroup END