liuchengxu / vim-clap

:clap: Modern performant fuzzy picker, tree-sitter highlighting, and more, for both Vim and NeoVim
https://liuchengxu.github.io/vim-clap/
MIT License
2.11k stars 86 forks source link

Can't change background color of the pop window #236

Closed delfick closed 4 years ago

delfick commented 4 years ago

Environment

Describe the bug I can't figure out how to change the background color of the popup window to be different than the background of my vim.

To Reproduce

  1. Create the minimal vimrc min.vim:
call plug#begin('~/.vim/plugged')

Plug 'liuchengxu/vim-clap'
Plug 'liuchengxu/vim-clap', { 'do': function('clap#helper#build_all') }
Plug 'iCyMind/NeoSolarized'

call plug#end()

set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types:h11

set termguicolors
set background=dark
let g:neosolarized_termtrans=1
colorscheme NeoSolarized

let mapleader=","
nmap <leader>a :Clap files<CR>
nmap <leader>q :Clap quickfix<CR>
nmap <c-p> :Clap buffers<CR>

hi default link ClapDisplay NeoSolarized
hi default link ClapInput   NeoSolarized

2: Open popup window

Screenshots

image

Additional context I tried for a long time with different combinations of hi commands and I couldn't figure it out.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.86. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

liuchengxu commented 4 years ago

NeoSolarized is not a valid highlight group. Try:

hi link ClapDisplay CursorLine
hi link ClapSpinner PmenuSel
hi link ClapInput   PmenuSel

and see :h highlight-groups.

delfick commented 4 years ago

I still get the same problem with those settings.

interestingly this works now

hi ClapDisplay2 guibg=#9ad9ff
hi default link ClapDisplay ClapDisplay2

I swear I tried it before and it wasn't working. sigh. Sorry for the noise

delfick commented 4 years ago

I got it much nicer

image

hi ClapDisplay2 guibg=#003f66
hi default link ClapDisplay ClapDisplay2

hi ClapInput2 guibg=#000000
hi link ClapInput ClapInput2

hi YellowAndBlack gui=bold guibg=#7a804d guifg=black
hi link ClapCurrentSelection YellowAndBlack 
hi link ClapNoMatchesFound YellowAndBlack

But I can't work out how to change the green color in the matches.

liuchengxu commented 4 years ago

:h g:clap_fuzzy_match_hl_groups

delfick commented 4 years ago

awesome, that worked :)

One last question, the color of the matches is controlled by ClapFuzzyMatches[1-12] ?

I'm confused by the [1-12] and setting this option doesn't seem to work.

i.e.

hi link ClapFuzzyMatches YellowAndBlack

Seems to make no difference.

liuchengxu commented 4 years ago

ClapFuzzyMatche1, ClapFuzzyMatche2...

With g:clap_fuzzy_match_hl_groups, you don' have to care about ClapFuzzyMatches[1, 12], they are doing the same thing and it should be noted as the deprecated option.

delfick commented 4 years ago

I mean the white text in this

image

liuchengxu commented 4 years ago

That's fg of ClapDisplay.

delfick commented 4 years ago

If I set say

hi ClapDisplay2 guibg=#003f66 guifg=#000000 ctermfg=black
hi default link ClapDisplay ClapDisplay2

The text remains white

liuchengxu commented 4 years ago

If some syntax ftplugin is enabled, the syntax of display buffer will override ClapDisplay. You can disable this behavior, but you'll lose the proper highlight then.

autocmd User ClapOnEnter call g:clap.display.setbufvar('&syntax', '')
hi ClapDisplay guibg=black guifg=red ctermbg=black ctermfg=red
delfick commented 4 years ago

hmm, in that minimal config I only have vim clap and NeoSolarized enabled

And NeoSolarized only has a colors directory in it.

Your line does work though

I'll give it a shot and see if I notice anything breaking.

Thanks!