Sometimes I want to use a minimal vim configuration, so with pathogen I have the following alias:
alias v='vim -u "$HOME/.vim/simple.vim" --noplugins'
and in the simple.vim file I have the following lines:
let g:p0 = split(&runtimepath, ',')[0]
exec "source" . g:p0 . "/plugin/NERD_commenter.vim"
this fails when g:p0 contains spaces. I tried
exec "source" . "'" . g:p0 . "/plugin/NERD_commenter.vim" . "'"
and also
exec "source" . '"' . g:p0 . "/plugin/NERD_commenter.vim" . '"'
but they both fail. Any ideas on how to solve this?
You should use the
fnameescape()functionOf course, even better would be using the
runtimecommand