2

I've installed perlbrew and it works: when I do a 'perl -v' in a terminal, it reports 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

user764169
  • 75
  • 3

2 Answers2

4

You can set the PATH variable in .vimrc:

let $PATH = "~/bin:" . $PATH 

You can take a look at what it is by

:echo $PATH
Axeman
  • 29,660
  • 2
  • 47
  • 102
  • thanks Axeman, it worked :-) use v5.14; system ('perl -v'); system ('which perl'); I'm using vim with the fantastic "Perl Support plugin", that implements a Perl-IDE for Vim/gVim – user764169 May 24 '11 at 13:23
1

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

yko
  • 2,710
  • 13
  • 15
  • "Trick" is an interesting way to put this. My only concern is with all of the extra cruft that this would add to Vim. – jackyalcine Nov 04 '14 at 22:29