Reputation: 10136
I am working on a plugin for Vim, and sometimes I have issues, that can't be reproduced with my plugin set. I would like to get users .vim
and .vimrc
, but I don't want to replace/move my files.
I want to know if it possible to set another directory to be used as .vim
and another file as .vimrc
?
Upvotes: 1
Views: 271
Reputation: 700
A simple solution is to use a symbolic link for the folder.
Note that if you put .vimrc
in .vim
the .
should be removed from the name: .vim/vimrc
.
my:
ln -sfn .vim myvimconf
friend:
ln -sfn .vim friendvimconf
Upvotes: 1
Reputation: 5367
I am not sure but I once used
vim -u ~otheruser/.vimrc -U ~otheruser/.gvimrc file
Edit: This is not enough; please see @Ingo solution
Upvotes: 0
Reputation: 172768
Building upon @JJoao's answer, you need to explicitly specify the .[g]vimrc
locations, and additionally replace the references to ~/.vim
in your 'runtimepath'
:
vim \
-u ~user/.vimrc -U ~user/.gvimrc \
--cmd "set rtp-=~/.vim" --cmd "set rtp-=~/.vim/after" \
--cmd "set rtp^=~user/.vim" --cmd "set rtp+=~user/.vim/after"
Upvotes: 4