本文介绍了Vim:仅在重新加载日光化配色方案后才突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 $HOME 目录下有以下最小的 .vimrc 文件(我在 Ubuntu 14.04 LTS 上,使用 vim-gnome):

 语法设置背景=暗颜色方案日晒

除了那些应该是粗体的之外,一切都按预期突出显示.

默认情况下,solarized 配色方案应该加粗 errors 和 todos.但是,它不会立即起作用.例如,打开一个文件并调用 :he group-name,我得到以下信息:

你可以看到 errortodo 不是粗体的.如果我现在重新加载:colo solarized 曝光,突出显示最终会正确:

那么这里出了什么问题?我如何才能正常工作?

解决方案

我找到了一个解决方法:

colo solarized 放在 /usr/share/vim/gvimrc 中解决了问题.

最初,我认为在 solarized.vimgvimrc 之间加载的某些脚本可能与 solarized.vim 的粗体设置冲突.但似乎并非如此,因为我尝试将 colo solarized 放在它们之间的每个脚本中(基于 :script 的输出),但没有效果.>

奇怪的是,只有将 colo solarized 放在 /usr/share/vim/gvimrc 中才能正常工作.

I have the following minimal .vimrc file under $HOME directory (I'm on Ubuntu 14.04 LTS, using vim-gnome):

syntax on
set background=dark
colorscheme solarized

And everything was highlighted as expected except for those supposed to be bold.

By default, solarized color scheme should bold errors and todos. However it doesn't work right away. For example, opening a file and invoking :he group-name, I get the following:

You can see error and todo are not bold. If I now reload solarized by :colo solarized, the highlighting will finally get correct:

So what goes wrong here? how can I get solarized to work properly?

解决方案

I have found an workaround:

Put colo solarized in /usr/share/vim/gvimrc solved the problem.

Initially, I thought some script loaded between solarized.vim and gvimrc might have conflicted with the bold setting of solarized.vim. But It seems not the case, because I've tried putting colo solarized in every script between them (based on output of :script), which has no effect.

Strangely, It only works fine to put colo solarized in /usr/share/vim/gvimrc.

这篇关于Vim:仅在重新加载日光化配色方案后才突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-12 00:18