On 08/11/08 14:12, François Ingelrest wrote:
> Hi all,
>
> The only highlight concerning the wildmenu I'm aware of is 'WildMenu'.
> This lets me choose how the current match should be highlighted, but I
> can't set the style of other entries in that menu. AFAICT, Vim
> automatically uses the highlight style of the status bar.
>
> This is annoying, because I like to use colors such as dark grey /
> white for this kind of things (e.g., completion menu, tabs), so that
> the current entry is clearly visible. However, to do that, I would
> have to set the foregound color of the status bar to dark grey,
> resulting in a status bar not easily readable most of the time (when
> the wildmenu is not currently used).
>
> Is there a solution to this problem?
AFAIK, there isn't; but it's only a problem if you want it to be. The
selected 'wildmenu' entry is in WildMenu highlight, and the rest in
StatusLine highlight. You can change them at any time, and the current
values will be used. In my colorscheme, I alternate the StatusLine
highlight between two contrasting values, and the WildMenu is set to the
other setting, as follows:
let s:colors_name = "almost-default"
[...]
" display the status line of the active window in a distinctive color:
" bold black on bright red in the GUI, white on green in the console
" (where the bg is never bright, and dark red is sometimes an ugly sort
" of reddish brown).
hi StatusLine gui=NONE,bold guibg=red guifg=black
\ cterm=NONE,bold ctermbg=darkgreen ctermfg=white
hi WildMenu gui=NONE,bold guibg=green guifg=black
\ cterm=NONE,bold ctermbg=black ctermfg=white
" make the status line bold-reverse (but B&W) for inactive windows
hi StatusLineNC gui=reverse,bold
\ cterm=NONE ctermbg=black ctermfg=lightgrey
" make the active status line colours alternate between two settings
" to give a visual notice of the CursorHold/CursorHoldI events
if ! exists("s:statuslineflag")
let s:statuslineflag = 0
endif
function! ToggleStatusLine()
if s:statuslineflag
hi StatusLine
\ cterm=NONE,bold ctermbg=darkgreen ctermfg=white
\ gui=NONE,bold guibg=red guifg=black
hi WildMenu
\ cterm=NONE,bold ctermbg=black ctermfg=white
\ gui=NONE,bold guibg=green guifg=black
else
hi StatusLine
\ cterm=NONE,bold ctermbg=black ctermfg=white
\ gui=NONE,bold guibg=green guifg=black
hi WildMenu
\ cterm=NONE,bold ctermbg=darkgreen ctermfg=white
\ gui=NONE,bold guibg=red guifg=black
endif
let s:statuslineflag = ! s:statuslineflag
endfunction
exe "augroup" s:colors_name
au! CursorHold,CursorHoldI * call ToggleStatusLine()
au! ColorScheme *
\ if g:colors_name != s:colors_name
\ | exe "au!" s:colors_name
\ | endif
augroup END
[...]
" remember the current colorscheme name
let g:colors_name = s:colors_name
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---