Change default location of vimrc

前端 未结 8 1649
一向
一向 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:42

    I see two options, depending on your needs.

    1. Have ~/.vimrc import the other location
    2. create an alias in your bashrc alias vim="vim -u otherlocation"
    0 讨论(0)
  • 2020-12-13 06:50

    In linux: You can edit .bashrc or .zshrc startup script and add the following lines to change the default location of .vimrc file

    export VIMINIT='source $MYVIMRC'
    export MYVIMRC='~/.vim/.vimrc'  # Note the . (dot) before vimrc. If that is what you have called it.
    
    0 讨论(0)
提交回复
热议问题