Use the :set command.
:set autoindent?prints the option, and its value, if any. Vim toggle options (booleans, options that are on/off), likeautoindent, are prefixed withnoto indicate that they’re turned off, so:set autoindent?will displayautoindentornoautoindent.:set autoindentturnsautoindenton.- this form turns toggle options on
- for number or string options, this shows the value of the option, so
:set textwidthwill also print the value of the option. For number or string options,:set optionis equivalent to:set option?.
:set autoindent!inverts the option.autoindentbecomesnoautoindent.:set autoindent&revertsautoindentto its default value.- Set number or string options with
:set option=value, e.g.set tabstop=3