search

Home  >  Q&A  >  body text

How does Vim load the specified .vimrc?

~/.vimrc is loaded by default when vim starts. How to specify to load .vimrc elsewhere?

ringa_leeringa_lee2743 days ago812

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-16 16:43:29

    vim -u 配置文件gvim -U 配置文件

    reply
    0
  • PHPz

    PHPz2017-05-16 16:43:29

    To load the Vim configuration in the specified directory, this is actually what I did (in the zsh initialization script):

    path=(~/lily/bin $path)
    export SHELL=/bin/zsh
    export MYVIMRC=$HOME/lily/.vim/vimrc
    export VIMINIT="let &rtp='$HOME/lily/.vim,' . &rtp
    so $MYVIMRC"
    export VIMTMP=$HOME/lily/tmpfs
    

    reply
    0
  • Cancelreply