Dado Feigenblatt wrote:
> My $PYTHONPATH changes depending on the project I'm working on.
> So I have this in my .vimrc
> set path+=$PYTHONPATH
> The path is getting set.
> The problem is that $PYTHONPATH is a colon separated list and
> path expects a comma separated list.
> I need to do something like
> set path+= `echo $PYTHONPATH | sed -e 's/:/,/g'`
> Any suggestion?
There are (at least) two ways:
:let &path = &path . substitute($PYTHONPATH, ":", ",", "g")
:execute "set path+=" . substitute($PYTHONPATH, ":", ",", "g")