简体   繁体   English

在vimrc中设置vim omnicompletion颜色(Pmenu)不起作用

[英]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" . 我正在尝试根据本指南自定义我的vim弹出窗口完成菜单: Vim Wiki:“Omni完成弹出菜单” It notes 它指出

add to your vimrc if you always want this choice. 如果您总是想要这个选择,请添加到您的vimrc。

However, with the following settings in my .vimrc file 但是,我的.vimrc文件中有以下设置

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? 如何让弹出窗口使用.vimrc中定义的颜色方案,而不必每次都手动输入?

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 请参阅vim - 覆盖colorscheme

Short answer is that you can't. 简短的回答是,你做不到。 If you use a colorscheme, then all other color scheme tweaks in your .vimrc are ignored. 如果使用colorscheme,则忽略.vimrc中的所有其他颜色方案调整。 The AfterColors plugin solved the problem for me. AfterColors插件为我解决了这个问题。

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. 尝试在没有选项集的filetype plugin on情况下运行它。

If that works, you'll need to adjust the filetype detection to run your special options afterwards. 如果可行,您需要调整文件类型检测以便之后运行您的特殊选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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