English 中文(简体)
全面背景:在维姆突出标识
原标题:Full width background color highlighting of codeblock in Vim

我的维姆文件有密码区,这些区域使用辛迪加,包括各区域,从主要文件中突出不同辛迪加。 例如,我有一个叫做Pyregion的Syntax地区,界定了我使用I/60/L。 该文件的底栖地区随后用在Avre syntax档案中,而该区域以外的地区则使用主要文件中的辛塔克斯文档。

我想把沙尔地区的整个背景混为一谈,使之与该文件的非邦特兰地区区别开来。 我可以通过为整个平线地区进入一个背景来掌握其中的一部分内容:

:highlight pyregion guibg=#555555

但是,上述指挥只改变具有文字特征的地区的背景,而不是该区域entire background,而这种背景似乎仍然像文件其他部分一样由为正常群体确定的背景图加以规范。 这是不错的——它确实提请人们注意该区域,但它有粗略的眼光,因为只有密码本身有不同的背景,而不是整个区域的横线。

能否在整个区域,而不仅仅是具有特征的区域,找到一个具有不同背景的统一带?

There s related question and answer in following link, but so far as I can tell that answer also changes background only where there is text: Highlight Code Block Backgrounds with Vim

感谢任何帮助。

最佳回答

我不认为,如果没有rid的牛群,这是可能的(见下文)。 如果你尝试:

:match Error /\%3l/

报告强调了Vim认为整个第3行的内容。 重点仅涉及特性的结束。 这使我怀疑,不可能强调不存在的特性。


现在停止阅读。

当然,作为干.的演习,你当然会把大量空间拖到每条线的终点,然后在你储蓄时予以拆除。 这将是虚伪的,但这是我所能想象的唯一东西。

" Add spaces to the end of every line (you could also do
" this selectively for lines that don t already have lots
" of spaces and you could do it on reading a file or whatever)
:exe  %s/$/  . repeat(   , 1000) .  / 
" Automatically remove spaces at the end of every line when saving
:autocmd BufWritePre %s/ *$//
" Make  A  append at the end of the non-space characters on the line
:nmap A / *$<CR>i
" Make  $  go to the end of the non-space characters on the line
:nmap $ /.? *$<CR>

免责:不这样做。

问题回答

是的,你可以通过签字指挥部这样做。

rel=“nofollow” http://vimdoc.sourceforge.net/htmldoc/sign.html

sign define 1 linehl=Error
sign place 1 name=er1 line=1 file=file.txt

重点介绍第一线档案。 绕过终点站。





相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签