Get current value of a setting in Vim

Viewed 88276

Is there a simple way of finding out the current value of a specified Vim setting? If I want to know the current value of, say tabstop, I can run:

:set tabstop

without passing an argument, and Vim will tell me the current value. This is fine for many settings, but it is no good for those that are either true or false. For example, if I want to find out the current value of expandtab, running:

:set expandtab

will actually enable expandtab. I just want to find out if it is enabled or not.

This sort of does what I want:

:echo &l:expandtab

but it seems quite verbose. Is there a quicker way?

4 Answers

Add a ? mark after the setting name and it will show the value

:set expandtab?

If you don't remember what setting you want to check, you can view all settings:

:set all

or show each setting, one setting per line:

:set! all
Related