简体   繁体   English

vimrc设置高亮模式

[英]vimrc set highlight mode

I have the following in my .vimrc file: 我的.vimrc文件中包含以下内容:

version 6.0

" set highlight mode
set highlight=8b,@-,db,es,lb,mb,M-,nu,rs,sr,tb,vr,ws

Which was largely borrowed from here . 大部分是从这里借来的。

I don't understand what this line does: 我不明白这行的作用:

set highlight=8b,@-,db,es,lb,mb,M-,nu,rs,sr,tb,vr,ws

I spent a few hours trying to figure out why my line numbers were not conforming to my colorscheme, and have traced it back to this line. 我花了几个小时试图弄清楚为什么我的行号不符合我的颜色方案,并将其追溯到这一行。 If I remove the nu from the list, my line numbers start highlighting correctly. 如果我从列表中删除nu ,则我的行号将开始正确突出显示。 I can't find any documentation explaining what any of those two-character patterns mean. 我找不到任何文档解释任何两个字符模式的含义。 Changing or removing the other ones does not seem to affect anything obvious. 更改或删除其他选项似乎并不会影响任何明显的事情。

Can someone please point me to some documentation that explains what's going on here? 有人可以给我指出一些说明这里发生什么情况的文档吗?

Edit: I read the :help highlight page in Vim, and could not find anything explaining this syntax. 编辑:我读了Vim的:help高亮页面,找不到任何解释此语法的内容。 If it exists in help, could someone please tell me how to find the relevant section? 如果在帮助中存在,有人可以告诉我如何找到相关部分吗?

As was in the comments, :help 'highlight' has your answers. 就像评论中一样, :help 'highlight'有您的答案。 Each argument is a pair of type-mode parameters. 每个参数是一对类型模式参数。

The meaning of each of the pairs you listed is: 您列出的每个对的含义是:

8b special characters for :map (eg <cr>) are bold
@- ~ characters after eof, along with some other special symbols, are not formatted
db directories are bold
es errors are standout
lb last search results are bold
mb more-prompt (when messages take up more than the screen) is bold
M- current mode (eg insert) is not formatted
nu line number is underlined
rs enter and y/n prompts are standout
sr status line of current window is reverse
tb titles of options (eg from :set all) are bold
vr visual highlighting is reverse
ws warnings are standout

If you wanted to customise these options, here's the meaning of each possible value for the mode parameter (second character): 如果要自定义这些选项,则这是mode参数(第二个字符)的每个可能值的含义:

r   reverse
i   italic
b   bold
s   standout
u   underline
c   undercurl
n   no highlighting
-   no highlighting
:   use a highlight group

I won't go into detail for all the possible type parameters (first character), but you can find them in the previously mentioned help page . 我不会详细介绍所有可能的类型参数(第一个字符),但是您可以在前面提到的帮助页面中找到它们。

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

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