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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With