作者Holocaust123 (奔跑的蜗牛)
看板Editor
标题[vim ] 如何在启动vim时不载入特定plugin
时间Tue May 3 12:05:09 2011
:h startup 提到,vim启动时会依序做这些动作:
1. Set the 'shell' and 'term' option
2. Process the arguments
3. Execute Ex commands, from environment variables and/or files
4. Load the plugin scripts.
...
10. ...
11. ...
12. ...
其中步骤三会source .vimrc
步骤四会source plugin
我想请问的是有没有办法在步骤三中
在.vimrc加入一些判断式
让步骤四的特定plugin不被source
(我的意思是连source都不source,而不是先source但後来再被disable)
目前我.vimrc中的判断式是这样写:
"CSApprox
"disable CSApprox if vim does not have +GUI support
"note: this setting does not work, but I don't know why
if(!has('gui'))
let g:CSApprox_loaded = 0
endif
但这个plugin(CSApprox)还是会被source
可见我这写法是有问题的 但尚不知理由
希望会的人能指点一下 感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.31.155
1F:→ curist:呃..那直接把那行放到.gvimrc可以吗? 05/04 00:02
我的gvim/vim共用同一个设定档(.vimrc)
另外 如果是指把if去掉 只写let那行 结果也是不行的
※ 编辑: Holocaust123 来自: 140.112.31.155 (05/04 00:40)
在别人的部落格找到解法了
http://marlonyao.iteye.com/blog/776784
※ 编辑: Holocaust123 来自: 140.112.31.155 (05/07 15:31)
2F:推 martinku:vim-addons-manager 也可以办到 但个人觉得有点肥= = 05/07 16:18