Change default location of vimrc

前端 未结 8 1722
一向
一向 2020-12-13 05:52

In Vim, is it possible to change the default location of the user vimrc file, i.e., from $HOME/.vimrc to some other location ?

8条回答
  •  孤城傲影
    2020-12-13 06:35

    I edited

    C:\Program Files\Vim\_vimrc
    

    and changed both the runtimepath and sourced my own .vimrc.

    I also use these settings in Cygwin (and have them version controlled). So it's this in practice (added at the bottom of the _vimrc file):

    let &runtimepath = 'C:\cygwin\home\cygwinaccount\.vim,' . &runtimepath
    source C:\cygwin\home\cygwinaccount\.vimrc
    

    Bliss ! :)

提交回复
热议问题