我希望非ascii字符显示为
here所讨论的,但是当非ascii字符在注释中时,语法高亮消失.稍微调查一下这个问题,我在vim-manual上发现,先前启动的项目具有更高的优先级(第3项).来自帮助:syn-priority:
原文链接:/bash/383391.htmlWhen several Syntax items may match,these rules are used:
When multiple Match or Region items start in the same position,the item defined last has priority.
A Keyword has priority over Match and Region items.
- An item that starts in an earlier position has priority over items that start in later positions.
我目前正在使用这个:
Syntax match nonascii "[^\x00-\x7F]" highlight nonascii cterm=underline ctermfg=red ctermbg=none term=underline
我尝试使用选项nextgroup给nonascii匹配项更高优先级:
Syntax match nonascii "[^\x00-\x7F]" nextgroup=Comment
并包含选项:
Syntax match nonascii "[^\x00-\x7F]" contains=ALL
但它不起作用.我还尝试暂时禁用评论(突出显示清晰的评论)而没有达到预期的效果(我的评论没有突出显示,但是nonascii继续没有突出显示).我错过了什么?