【发布时间】:2012-04-04 17:11:15
【问题描述】:
[已解决] 看来解决办法是这样的:
if exists('g:nameOfMyOption') && g:nameOfMyOption
...
endif
这很简单,但我在网上找不到答案。我想在插件文件中做这样的事情:
" MyChecker.vim
"
" Uncomment the following line to set the autochecker option
"set autochecker=1
if ISSET(autochecker)
autocmd InsertChange * :call MyAutoCheckerFunction()
endif
如何进行 ISSET 生产线?我宁愿不必显式设置 autochecker=0,我希望它只检查 autochecker 是否存在。
编辑:当我尝试以下操作时:
if &autochecker == 1
...
endif
我收到此错误消息:
Error detected while processing MyChecker.vim:
line 32:
E113: Unknown option: autochecker
E15: Invalid expression: &autochecker == 1
【问题讨论】: