I have Vim 7 installed from my distro's package manager, and I compiled Vim 8 from source. Vim 8 is all in /usr/local. Then I created a new directory in $HOME called ".vim8". I have all my Vim 7 stuff in $HOME/.vim/, and I want a clean directory for Vim 8 in $HOME/.vim8/.
For Vim 8, I'm calling it like this: /usr/local/bin/vim8 -u "${HOME}/.vim8/vimrc"
.
That sets the vimrc to the right file. But it still doesn't load other things in ${HOME}/.vim8/
. For example, I have the NERDTree plugin installed in pack:
$ tree -L 5 $HOME/.vim8/
/home/todd/.vim8/
├── pack
│ └── vendor
│ └── start
│ └── nerdtree
│ ├── autoload
│ ├── CHANGELOG.md
│ ├── doc
│ ├── lib
│ ├── LICENCE
│ ├── nerdtree_plugin
│ ├── plugin
│ ├── README.markdown
│ ├── screenshot.png
│ └── syntax
└── vimrc
Yet the plugin doesn't load. When I open vim8 I can't use NERDTree. It says it's not an editor command. Thinking about why this would be happening, I came up with a possibility: maybe it's using $HOME/.vim8/vimrc
as the rc file, but it's not using $HOME/.vim8
for everything else. So I did this:
$ vim8 -u "${HOME}/.vim8/vimrc" -T dumb -c ':scriptnames|:q'
1: ~/.vim8/vimrc
2: /usr/local/share/vim/vim82/syntax/syntax.vim
3: /usr/local/share/vim/vim82/syntax/synload.vim
4: /usr/local/share/vim/vim82/syntax/syncolor.vim
5: ~/.vim/filetype.vim
6: /usr/local/share/vim/vim82/filetype.vim
[ ...and a bunch of other files from local... ]
Aha! It appears I'm right. Vim is still looking in the .vim/ directory. So then I try setting runtimepath:
$ vim8 -u "${HOME}/.vim8/vimrc" --cmd ':set runtimepath=~/.vim8/,$VIMRUNTIME' -T dumb -c ':scriptnames|:q'
1: ~/.vim8/vimrc
2: /usr/local/share/vim/vim82/syntax/syntax.vim
3: /usr/local/share/vim/vim82/syntax/synload.vim
4: /usr/local/share/vim/vim82/syntax/syncolor.vim
5: /usr/local/share/vim/vim82/filetype.vim
[ ...and a bunch of other files from local... ]
And now it's not loading anything from .vim/. That's good. But also still not loading anything from .vim8/. NERDTree is still not available.
How do I tell Vim to use an alternate user directory for runtime files? I want to keep the 7 and 8 configuration separate and side-by-side. Is there anything I can do make Vim 8 use $HOME/.vim8/
?