문제

How can I disable autocomplete in Vim when writing a comment or docstring? I tried au FileType * setl fo-=cro and set fo-=c fo-=o fo-=r but that didn't help. I use Neocomplete.

도움이 되었습니까?

해결책

My OnSyntaxChange plugin may help with this.

First, you need to generate events when entering / leaving comments:

call OnSyntaxChange#Install('Comment', '^Comment$', 0, 'i')

Then, hook commands to enable / disable the auto completion to the events. Fortunately, Neocomplete provides those:

autocmd User SyntaxCommentEnterI silent! NeoCompleteLock
autocmd User SyntaxCommentLeaveI silent! NeoCompleteUnlock

See also this question, which does something similar for the AutoComplPop plugin.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top