简体   繁体   中英

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

 au BufWritePost .vimrc source ~/.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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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