简体   繁体   English

在退出程序之前,vim不会提供.vimrc文件的资源

[英]vim is not resourcing the .vimrc file until exiting the program

i have asked this question and so far nobody seems to be able to come up with a reasonable reason as to why my resource file is not being resourced. 我已经问过这个问题,到目前为止,似乎没有人能够为我的资源文件未得到资源提供合理的理由。 :source $MYVIMRC :so ~/.vimrc :source $MYVIMRC :so ~/.vimrc

 au BufWritePost .vimrc source ~/.vimrc

:echo $MYVIMRC == /Users/******/.vimrc . :echo $MYVIMRC == /用户/Users/******/.vimrc Any help would be greatly appreciated as a week to having this problem (new mac) i am having to exit vim and re enter. 任何帮助将不胜感激,因为一周我遇到了这个问题(新mac),我必须退出vim并重新输入。

I think there can be a possible problem with how the files are called within each platform. 我认为在每个平台内如何调用文件可能存在问题。 Try cross-platform solution found here : 尝试在这里找到跨平台解决方案:

au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') && filereadable($MYGVIMRC) | so $MYGVIMRC | endif

or better 或更好

augroup myvimrc
    au!
    au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') && filereadable($MYGVIMRC) | so $MYGVIMRC | endif
augroup END

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM