correct perl path for vim
I've installed perlbrew and it works: when I do a 'perl -v' in a terminal, it rep开发者_StackOverflow中文版orts that I'm using perl 5.14. But gvim (vim instead works) still thinks that I'm using 5.10...
How do I set the perl path for gvim?
thanks
You can set the PATH
variable in .vimrc:
let $PATH = "~/bin:" . $PATH
You can take a look at what it is by
:echo $PATH
There's also trick to enable path defined by perlbrew, so you don't need to change your .vimrc
once you switched to other perl version:
" Enable perlbrew path
if has("gui_running") && filereadable($HOME . "/perl5/perlbrew/etc/bashrc")
let $PATH=system("source " . $HOME . "/perl5/perlbrew/etc/bashrc; echo -n $PATH")
endif
Put this code in your .vimrc
and restart vim
精彩评论