tags:

views:

24

answers:

1

I'm running portable python and portable gvim. When I run gVimPortable, I want it to append python to the PATH environment variable. This is the command I would run in a command prompt:

path=%path%;C:\portable\PortablePython_1.1_py2.5.4

Is there a way to automate this in the vimrc file or some other way?

+2  A: 

You can change environment variables inside Vim using the :let command.

let s:portablepy = 'C:\portable\PortablePython_1.1_py2.5.4'
" Add PortablePython's path to $PATH if running on Windows and PortablePython exists
if (has('win32') || has('win64')) && isdirectory(s:portablepy)
    let $PATH .= ';' . s:portablepy
endif
jamessan
Perfect. Just what I was looking for.
Jim