Re: pattern substitution in vim script
- Dado Feigenblatt wrote:
>There are (at least) two ways:
> 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?
:let &path = &path . substitute($PYTHONPATH, ":", ",", "g")
:execute "set path+=" . substitute($PYTHONPATH, ":", ",", "g")