作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已成功设置我的 linestatus
配置。然而,唯一缺少的是一些背景颜色,无论是整行还是特定元素。我该如何设置它们?
最佳答案
您需要将颜色定义为新的高亮组 User1、User2 等:
hi User1 ctermbg=blue ctermfg=white guibg=blue guifg=white
hi User2 ctermbg=black ctermfg=red guibg=black guifg=red
set statusline=
set statusline+=%1* " Switch to colour User1
set statusline+=%F
set statusline+=%* " Switch to default colour
set statusline+=%P
set statusline+=%2* " Switch to colour User2
set statusline+=%c
Folded
语法与当前
Normal
相同句法。我通过指导
hi Normal
的输出来做到这一点。到一个变量,然后从中提取各种信息。
redir => hinorm
sil exe 'hi Normal'
redir END
if hinorm =~ 'cleared'
sil exe 'hi clear Folded'
else
let guibg = matchstr(strtrans(hinorm),'guibg=[#a-zA-Z0-9]*')
let guifg = matchstr(strtrans(hinorm),'guifg=[#a-zA-Z0-9]*')
sil exe 'hi Folded ' . guibg
sil exe 'hi Folded ' . guifg
endif
关于configuration - 更改 vim 的 linestatus 颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8383787/
我已成功设置我的 linestatus配置。然而,唯一缺少的是一些背景颜色,无论是整行还是特定元素。我该如何设置它们? 最佳答案 您需要将颜色定义为新的高亮组 User1、User2 等: hi Us
我是一名优秀的程序员,十分优秀!