I'm looking for a way to make a single configuration file both for windows platform and for unix one. So for now i have two configs .vimrc for unix and _vimrc for windows platform and the only difference between them is a necessary commands to vundle plugin manager. (i desregard the difference with filename, as i aim only to store a common version of file on my dotfiles repo and symlink with the right name at place)
Unix:
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
Plugin 'VundleVim/Vundle.vim'
...
call vundle#end()
Win:
set rtp+=$HOME/vimfiles/bundle/Vundle.vim/
call vundle#begin('$USERPROFILE/vimfiles/bundle/')
Plugin 'VundleVim/Vundle.vim
...
call vundle#end()
So it's boring to maintain changes in both as i'm working on linux as well on windows platform. I guess i could do operating system detection like if has("win32")
but i think it's not a good idea to wrap every system dependent statement in construction like this. I'm wondering if there any option to this and how you deal with this.
let $MYLOCALVIMRC = has('win32') ? "~/_windows.vim" : "~/.unix.vim"
then you can test if the file exists (if filereadable($MYLOCALVIMRC)
) and source it (source $MYLOCALVIMRC
). It works pretty well I use that in my own vimrc.if has("win32") set rtp+=$HOME/vimfiles/bundle/Vundle.vim/ call vundle#begin('$USERPROFILE/vimfiles/bundle/') else set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#rc() endif
but it's only requirement of plugin. May be someone has configuration with two lines - one for rtp and another for the procedure start. If not i will keep on with this config.