Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I inspect Vim variables?

Tags:

variables

vim

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.

like image 663
Kit Avatar asked Feb 08 '12 12:02

Kit


People also ask

How do I find vim settings?

vim is provided with Vim. When run, the script produces a file with information about Vim's environment. To see the script, use the command :view $VIMRUNTIME/bugreport. vim in Vim.

What is echo in Vim?

Plain old :echo will print output, but it will often disappear by the time your script is done. Using :echom will save the output and let you run :messages to view it later.


2 Answers

:echo g:SuperTabDefaultCompletionType 

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

like image 181
lucapette Avatar answered Oct 07 '22 00:10

lucapette


Like lucapette wrote you can use :echo g:foo to inspect a variable. You can also use :let to see all defined variables and their values.

like image 35
beta Avatar answered Oct 06 '22 23:10

beta