In my $VIMRC I have:
nnoremap <leader>A :set formatoptions+=a<cr> nnoremap <leader>a :set formatoptions-=a<cr>
What I'm wondering is if there's something more like:
nnoremap <leader>A :set formatoptions!=a<cr>
that takes the value of a (the
formatoptions flag) and inverts it (if set, unset it, otherwise set it).
This would be like
nnoremap <leader>s :set spell!<cr>
but for options where it takes flags rather than it being a true/false boolean. I'd like to accomplish this without getting into vimscript and if/else loops.