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/localor/opt? - Endianness: amd64 is LE, while SparcV9 is BE
- Absolute paths recorded at installation time
- Availability of and
PATHto 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.
ln -s path/to/repo/repo_vimrc ~/.vimrc. See here and here for examples. – mattb Feb 20 '22 at 17:39.vimdirectory is a very common practice and there are several approaches so I think this question is too vague. – statox Feb 21 '22 at 14:22.vimdirectory, simply clone it but don't include the plugins (instead use:PlugInstallof 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 Feb 21 '22 at 14:24.vimis apparently not a good idea. – Jens Feb 21 '22 at 14:31.vimrc, but I am interested in the portability of what's in the.vimtree (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 Feb 21 '22 at 14:34.vimrcis not the same as the contents of the.vimdirectory tree. Can that be cloned without surprises when it has plugins installed? Or do I need to install plugins on each system, as @statox appears to recommend? – Jens Feb 21 '22 at 14:41set backupdir=path/to/dotfile/repo/back_up//andset directory=path/to/dotfile/repo/swap//andset undodir=path/to/dotfile/repo/undo//to keep those things synced too. – mattb Feb 21 '22 at 14:59.vimand.vimrcare not the same, since vim 7.4 the.vimrcis expected to be in the.vimdirectory. So it's still very related. What I do is that I simply version my.vimdirectory and addvim/pluggedandvim/viminfoto the.gitignoreand I never had any issue – statox Feb 21 '22 at 15:59