如何评论禁用AutoComplPop完工? [英] How to disable AutoComplPop completions in comments?
问题描述
我最近开始使用 AutoComplPop ,但我发现弹出烦人的,当我写的注释(如我一般写评论时,不需要autocomplition)。
I've recently started using AutoComplPop, but I find the popup annoying when I'm writing comments (as I usually don't need autocomplition when writing a comment).
有一个配置选项或一个快速的黑客工具,可以有效地禁用AutoComplPop当插入点在评论?
Is there a configuration option or a quick hack that can effectively disable AutoComplPop when the insertion point is in a comment?
推荐答案
要检查每一个光标移动的语法时,回答的性能问题,我不得不实施这个自己,并制作成的 OnSyntaxChange 插件
To answer the question of performance when checking the syntax on every cursor move, I had to implement this myself, and made this into the OnSyntaxChange plugin.
有了这个插件,设置此功能可以在短短的三根线来完成(例如,在.vimrc里):
With this plugin, setting this up can be done in just three lines (e.g. in .vimrc):
call OnSyntaxChange#Install('Comment', '^Comment$', 0, 'i')
autocmd User SyntaxCommentEnterI silent! AcpLock
autocmd User SyntaxCommentLeaveI silent! AcpUnlock
对于我来说,对性能的影响是显着的(根据文件类型和语法),但可以忍受的。尝试一下吧!
For me, the performance impact is noticeable (depending on the filetype and syntax), but tolerable. Try for yourself!
这篇关于如何评论禁用AutoComplPop完工?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!