简体   繁体   English

如何在 vim 中更改字符串 colors

[英]How can I change the String colors inside vim

I installed a solarised dark theme in my iterm2 zsh and everything looks fine.我在 iterm2 zsh 中安装了一个日光化的深色主题,一切看起来都很好。 But when I open vim, for some reason, the contrast on the strings aren't really good and it's really hard to read strings.但是当我打开 vim 时,由于某种原因,字符串的对比度不是很好,而且很难读取字符串。

I tried setting set background=dark but nothing worked.我尝试设置set background=dark但没有任何效果。 Here's a screenshot of how it looks like这是它的外观截图在此处输入图像描述

How do I change the dark blue color of the string so that it's more readable?如何更改字符串的深蓝色以使其更具可读性?

BTW, I checked out highlights in vim and for Strings, I got this xxx term=underline ctermfg=13 guifg=#ffa0a0 , but #ffa0a0 is the color of light red which I could work with.顺便说一句,我检查了 vim 和字符串中的亮点,我得到了这个xxx term=underline ctermfg=13 guifg=#ffa0a0 ,但#ffa0a0是我可以使用的浅红色。

I could be wrong since I am not using solarized myself but the colors all seem off so you might want to have a look at Incorrect colors with vim in iTerm2 using Solarized我可能是错的,因为我自己没有使用太阳能,但是 colors 似乎都关闭了,所以你可能想看看Incorrect colors with vim in iTerm2 using Solarized

Here you can find a great explanation on how overrinding works in vim在这里您可以找到关于 vim 中覆盖如何工作的很好的解释

That said, your override may have failed because you did not have the correct highlight-group.也就是说,您的覆盖可能失败,因为您没有正确的突出显示组。 You could try (see:help highlight)你可以试试(见:帮助高亮)

    :so $VIMRUNTIME/syntax/hitest.vim

this should show you the currently active highlight-groups and the links between them.这应该向您显示当前活动的突出显示组以及它们之间的链接。 There you might find the hightlight-group that has the dark blue color you mentioned.在那里,您可能会找到具有您提到的深蓝色的 hightlight-group。 If so you can change it (or the dependent hightlight-group for a specific FileType).如果是这样,您可以更改它(或特定文件类型的依赖高亮组)。

:hi <hightlight-group-name> ctermfg=<color> guifg=<color>

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

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