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.14k stars 47 forks source link

How to enable inversed highlight? #62

Closed quantum-booty closed 3 years ago

quantum-booty commented 3 years ago

The srcery colour scheme has an inversed highlight option which looks like this: image

Whereas vim-illuminate does looks like this: image

Is is possible to enable this inverse highlighting with illuminate?

let g:python3_host_prog = '/home/henryw/virtualenvs/data_sci/bin/python'
au BufNewFile,BufRead *.py set filetype=python

call plug#begin('~/.config/nvim/plugged')
Plug 'RRethy/vim-illuminate'
Plug 'srcery-colors/srcery-vim'
call plug#end()

let g:Illuminate_delay = 10
let g:Illuminate_highlightUnderCursor = 0

set termguicolors

let g:srcery_italic = 1
let g:srcery_bold = 1
let g:srcery_inverse_matches = 1
let g:srcery_inverse = 1
let g:srcery_italic_types = 1
let g:srcery_inverse_match_paren = 1
colorscheme srcery
RRethy commented 3 years ago

For non-lsp highlighting, it is done using :h illuminatedWord (which defaults to CursorLine) and :h illuminatedCurWord (which defaults to the same as illuminatedWord). While for the lsp highlighting, it is done using the highlight groups LspReferenceText, LspReferenceRead, and LspReferenceWrite.

To get inverse highlighting, you can use the inverse attr for gui (see :h attr-list in the Neovim help docs) as follows:

hi illuminatedWord gui=inverse
hi LspReferenceText gui=inverse
hi LspReferenceRead gui=inverse
hi LspReferenceWrite gui=inverse