How to invoke Linux shell env variable into vimrc ?
I split vimrc configurations into multiple files and included these files in vimrc via :runtime [file]
.
This works well.
:runtime vimrc.d/vimrc.pathogen " pick one and comment others
":runtime vimrc.d/vimrc.vim-plug
":runtime vimrc.d/vimrc.vundle
After that, I want to define a variable in vimrc to specify which vimrc.x can be used.
A single or double quotation needed here for a vimrc variable
let vimrc_plugin_manager=pathogen " It shows Undefined variable: aaa
let vimrc_plugin_manager="pathogen" " both '' and "" here works find
The following doesn't work.
let vimrc_plugin_manager='pathogen'
:runtime vimrc.d/vimrc.&{vimrc_plugin_manager} " This doesn't work
And finally, I want to move the variable from vimrc to shell ENV, and want it to be invoked in vimrc.
Shell
export VIMRC_PLUGIN_MANAGER=pathogen
vimrc
let vimrc_plugin_manager=&VIMRC_PLUGIN_MANAGER " invoke shell env var to vimrc; seems not work
:runtime vimrc.d/vimrc.&{vimrc_plugin_manager} " This doesn't work
How can it work? I have searched a lot and havent' find solution yet.