toggle options more efficiently
January 27, 2004 – 22:29 | vimOne useful yet often overlooked way to toggle an option is
:set {option}!
The good thing about it is you don’t have to figure out whether to use “no” in front of the option name. E.g., You can keep doing “set wrap!” (ideally with command history), instead of keeping jumping back and forth between “set wrap” and “set nowrap”. Also when you want to map this command, only one mapping is necessary.
