I'm trying to figure out how to use an environment variable name in a function, passed in as a function argument, i.e.:
function! myautoloadfunc#set_default_env_var(name, value) if empty($a:name) let $a:name = a:value endif endfunction call myautoload#set_default_env_var('SOME_VAR', 'SOME_VALUE')
Obviously that doesn't work, I'm pretty sure I can do this with
exec, but not sure if there's a more efficient way. Any suggestions?
Edit: It seems that the following works:
call myautoload#set_default_env_var('$SOME_VAR', 'SOME_VALUE')