I'm at home on a few unixy systems, FreeBSD/amd64, Linux/amd64 and Solaris/Sparc. I would like my ~/.vim directory as portable as possible, ideally in such a way I can keep them identical (say, rsync them after modifying my reference installation).

How portable is a vim configuration with installed plugins?

I can think of a few possible issues getting in the way of full portability (defined as copy all files from your reference and everything just works). Assume major and minor versions of vim are the same.

  • Do plugins install files outside of ~/.vim, say /usr/local or /opt?
  • Endianness: amd64 is LE, while SparcV9 is BE
  • Absolute paths recorded at installation time
  • Availability of and PATH to third party tools (python 3, ...)
  • termcap vs. terminfo
  • Anything else I have missed

Before I just do it, is copying everything a dumb idea waiting to fail? Anything else I should watch out for? I'm happy to have some code in my .vimrc conditional on the OS or host I'm on.

Note: I know .vimrc is pretty portable. That's no what I'm asking. I am specifically interested in the portability of the whole .vim directory, where plugins are installed and configured.

  • 1
    If you put a vimrc file in github repo, you can clone that on any machine and then create a link to it: ln -s path/to/repo/repo_vimrc ~/.vimrc. See here and here for examples.
    – mattb
    Commented Feb 20, 2022 at 17:39
  • For reference we had several other questions on the same topic. Sharing your dotfiles and especially your .vim directory is a very common practice and there are several approaches so I think this question is too vague.
    – statox
    Commented Feb 21, 2022 at 14:22
  • But basically everything is supposed to be in you .vim directory, simply clone it but don't include the plugins (instead use :PlugInstall of the equivalent for your plugin manager when you clone your dotfiles). You can also add some tests with :h has(), :h filereadable() and this kind of helpers commands to customize your vimrc according to the machine you are setting it up on.
    – statox
    Commented Feb 21, 2022 at 14:24
  • @statox The plugin issue is exactly an item I am worried about. How do I exclude those from copying? So a simple clone of .vim is apparently not a good idea.
    – Jens
    Commented Feb 21, 2022 at 14:31
  • @statox The other answers you refer to talk about .vimrc, but I am interested in the portability of what's in the .vim tree (also in the question title). This is why I asked a new question. It appears this is not yet addressed in any of the other questions.
    – Jens
    Commented Feb 21, 2022 at 14:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.