简体   繁体   中英

Setting vim omnicompletion colors (Pmenu) in vimrc not working

I am trying to customize my vim popup completion menu as per this guide: Vim Wiki: "Omni completion popup menu" . It notes

add to your vimrc if you always want this choice.

However, with the following settings in my .vimrc file

colo desert

filetype plugin on
set ofu=syntaxcomplete#Complete
highlight Pmenu guibg=brown gui=bold

I get the following:

Gahhhh!我的眼睛!

Note: when I manually enter the highlight command manually, it works:

在此输入图像描述

How do I get the popup to use a color scheme defined in .vimrc without having to enter it in manually each time?

if you put your commands in below sequence, you can get what you want. the syntax option will override your highlight option.

"" gui configuration
color murphy
syntax one
highlight Pmenu guibg=brown gui=bold

在此输入图像描述

See vim - Override colorscheme

Short answer is that you can't. If you use a colorscheme, then all other color scheme tweaks in your .vimrc are ignored. The AfterColors plugin solved the problem for me.

Hmm, most likely there is a highlighting command coming afterwards that is overriding your option. Probably when the filetype is determined and adjusts options. Try running it without the filetype plugin on option set.

If that works, you'll need to adjust the filetype detection to run your special options afterwards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM