From e573b3020c032400eed60b649a2cbf55266e6bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Jun 2016 16:03:25 +0200 Subject: Add current configurations from old repository --- vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim (limited to 'vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim') diff --git a/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim b/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim new file mode 100644 index 0000000..d8af33a --- /dev/null +++ b/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim @@ -0,0 +1,12 @@ +" in sh/bash you can type export to get a list of environment variables +" This function assigns those env vars to Vim. +" Does not delete env vars yet +" Example: env_reload#ReloadEnv(system("sh -c 'export'") +fun! env_reload#ReloadEnv(bash_export_command_output) + for i in split(a:bash_export_command_output,"\n") + let m = matchlist(i, 'export \([^=]\+\)="\(.*\)"') + if empty(m) | continue | endif + " don't care about quoted values right now. + exec 'let $'.m[1].'='.string(m[2]) + endfor +endf -- cgit v1.2.3