Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to customize highlight groups #16

Closed
lervag opened this issue Jul 30, 2018 · 3 comments
Closed

Allow to customize highlight groups #16

lervag opened this issue Jul 30, 2018 · 3 comments

Comments

@lervag
Copy link

lervag commented Jul 30, 2018

It seems that the cursorword#highlight function overrides my attempts at customizing the CursorWord[01] highlight groups. Would it be possible to make a minor change that allows me to customize these groups?

@lervag
Copy link
Author

lervag commented Jul 30, 2018

At least, it seems trivial to allow to customize the CursorWord0 group. I see that there is some minor magic for the CursorWord1 group which might complicate things.

@itchyny
Copy link
Owner

itchyny commented Jul 30, 2018

Try let g:cursorword_highlight = 0, the plugin stops setting the highlight colors.

@lervag
Copy link
Author

lervag commented Jul 31, 2018

That seems close to what I want. And I guess I can achieve my desired customization with something like this:

let g:cursorword_highlight = 0

augroup cursorword
  autocmd!
  autocmd VimEnter,ColorScheme * call MyHighlight()
augroup END

function! MyHighlight() abort
  highlight CursorWord0 cterm=bold gui=bold

  redir => out
    silent! highlight CursorLine
  redir END
  execute 'highlight CursorWord1 cterm=underline gui=underline'
    \ matchstr(out, 'ctermbg=#\?\w\+')
    \ matchstr(out, 'guibg=#\?\w\+')
endfunction

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants