检查VIM语法区域是否存在并删除
背景:
perl文件的语法突出显示有时对于大文件(1k+ lines)的有时非常慢。。。
我使用:
进行了介绍
:syntime on
"*** Do some slow actions ***
:syntime report
有许多慢慢执行的区域,例如:
perlstatementproc
i 通过删除一些缓慢执行的语法区域(还有更多):
,可以显着提高性能:
:syntax clear perlStatementProc
- 现在,我想在可能没有定义的特定区域的其他机器上使用这些改进,并在其他机器上进行这些改进。
我看到此错误打开VIM时:
E28: No such highlight group name: perlStatementProc
如何检查语法区域名称PerlstatementProc
是否存在?
Background:
Syntax highlighting for perl files is extremely slow at times for large files (1k+ lines).
I profiled using:
:syntime on
"*** Do some slow actions ***
:syntime report
There were many slowly performaning regions, like:
perlStatementProc
I significantly improved performance by removing some of the slowly performing syntax regions (there are more):
:syntax clear perlStatementProc
- Now I want to use this vimrc with these improvements on a different machine which may not have a specific region defined.
I am seeing this ERROR when opening Vim:
E28: No such highlight group name: perlStatementProc
How can I check if the syntax region name perlStatementProc
exists?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了有关
hlexists
的信息,并在我的vimrc中实现了此解决方案:I found out about
hlexists
and implemented this solution in my vimrc: