How do I inspect Vim variables?

Kit picture Kit · Feb 8, 2012 · Viewed 56.4k times · Source

In .vimrc, there are several lines that look like:

let g:SuperTabDefaultCompletionType="<c-x><c-o>"

How do I inspect them inside Vim? Something to this effect:

:echom &g:SuperTabDefaultCompletionType

But that command results in an error:

E113: Unknown option: SuperTabDefaultCompletionType
E15: Invalid expression: &g:SuperTabDefaultCompletionType

How do I inspect these kinds of variables in Vim? Some plugins set some defaults which I need to inspect.

Answer

lucapette picture lucapette · Feb 8, 2012
:echo g:SuperTabDefaultCompletionType

works fine. It gives an error if the variable isn't defined.