Let\'s say I have a tarball of all my vim config - everything normally inside ~/.vim (plugins, autoload, colours, all that stuff), and a vimrc file. I extract this to a director
I have a portable .vim
folder exactly as you described, this is how I have set it up:
Put your portable .vimrc
file inside your .vim
folder.
Add the following lines to the start of your portable .vim/.vimrc
:
" set default 'runtimepath' (without ~/.vim folders) let &runtimepath = printf('%s/vimfiles,%s,%s/vimfiles/after', $VIM, $VIMRUNTIME, $VIM) " what is the name of the directory containing this file? let s:portable = expand(':p:h') " add the directory to 'runtimepath' let &runtimepath = printf('%s,%s,%s/after', s:portable, &runtimepath, s:portable)
vim -u /path/to/portable/vim/.vimrc
.