How to set an option using a string in a vim script
The problem is set
does not support using string variables and let
does not support += for string types.
This should work:
let g:foo_path = '~/.vim/bundle/foo/foo.vim/'
let &rtp.= ',' . g:foo_path