Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you query what a variable/setting in vim is set to?

Tags:

vim

For example, in vim, if I want to know if autoread is set or not, is there a command I can run to tell me? Or to know what my tabstop is set to?

like image 636
Cory Klein Avatar asked Mar 15 '11 15:03

Cory Klein


3 Answers

In your case, :set autoread? will give you the current value of autoread. Generally, set foo? will give you the value of option foo.

:set will display all options that are different from default.

like image 59
Xavier T. Avatar answered Nov 08 '22 06:11

Xavier T.


:verbose set autoread? will tell you what set autoread and its value.

like image 28
Raimondi Avatar answered Nov 08 '22 05:11

Raimondi


You can also do, for example,

echo &ft

The & refers to the contents of the variable. I find this useful in scripts.

like image 28
Prince Goulash Avatar answered Nov 08 '22 05:11

Prince Goulash