On 21/11/09 20:15, Mark Manning wrote:
>
> I was wondering if there is a list anywhere on all of the $<VARIABLES>
> which VIM has.  For instance, if you do a help on $VIM (i.e.: :h $VIM)
> you get information on the $VIM variable.  But if you do the same for
> $OS you get an error.
>
> However, if you do
>
>      :echo $OS
>
> Vim comes back with what operating system you are currently running
> under.  I am sure there are more of these variables - but I can not find
> a list of them.  Thus - the question.
>
> TIA!  :-)
>
> Mark
>
> PS: I know someone's going to say "Why do you need to do this?"
> Example:  How to get the current date/time.  Mac and Linux do it one
> way, Windows does it another.  If you want to write a function that acts
> according to a given OS - you need to know the OS.  True - there are not
> a lot of reasons to need this, but there are sometimes when you do need
> it.  :-)

Try the following:

        :new
        :0r !set

(with a space before the exclamation mark). In some shells, including 
(but not necessarily limited to) command.com, cmd.exe and bash, this 
will answer your question. It should show you the environment Vim passes 
to the processes it spawns, most of which it will have inherited from 
whatever shell or window-manager launched it.

Another possibility (to get the names but not the values) is

        :echo $^D

where ^D means "hit Ctrl-D".


Best regards,
Tony.
-- 
A baby is an alimentary canal with a loud voice at one end and no
responsibility at the other.

-- 
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui