Tip 37 Printable Monobook Previous Next
created March 7, 2001 · complexity basic · author slimzhao · version 5.7
The many ways to set a boolean option are best illustrated by a simple example. In the following, the 'number' option is used. Any boolean option, such as wrap, linebreak, diff, etc. can be set in these ways.
:set number |
Turn line numbers on |
:set nonumber |
Turn line numbers off |
:set invnumber :set number! |
Toggle line numbers |
:set number& |
Set line numbers option to default value |
:set number? |
Show value of line numbers option |
Replace number
with any boolean option.
For nonboolean options, :set option&
also sets the option to its default value. :set option?
will also work in the general case.