Likewise, how do I find $VIMRUNTIME?
I installed vim using yum install vim-X11 vim-common vim-enhanced vim-minimal on CentOS 6.3
To find $VIM and $VIMRUNTIME, you can run
:echo $VIM
:echo $VIMRUNTIME
and to answer what is $VIM, you can run
:h $VIM
The environment variable "$VIM" is used to locate various user files for Vim, such as the user startup script ".vimrc". This depends on the system, see startup.
Inorder to set these environment variables, use
:let $VIM = "/path/to/directory"
:let $VIMRUNTIME = "/path/to/directory"
You can also find $VIM and $VIMRUNTIME from console or if you want it in a shell script
vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIMRUNTIME|quit' | tr -d '\015'
vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIM|quit' | tr -d '\015'
These are the environment variables set by vim when you are inside vim and spawn a shell from within vim. You won't find them set in any other case.
For example, if you run :!bash from vim, then the spawned shell will have both these environment variables set.
You should run :help $VIM to know more about both of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With