I currently have this handy toggle for swapping between regular insert and paste mode, while conveniently showing the line numbers only in regular insert mode:
nnoremap <F2> :set nu! paste!<Return>
I'd like to now add a third toggle state (a three-way toggle) which adds this additional state, otherwise identical to the normal insert mode (for writing normal text):
set set linebreak nnoremap j gj nnoremap k gk iab for for
That last one is to counter a
for abbreviation in my 'regular' insert mode.
The first thing I tried was to create a VIM function that when called would rotate a variable between three states. Here, I found my first problem. How does one create a variable in VIM that is persistent from call to call?
The second issue I'm running into is the text "insert (special)" on the command line. How does one configure this text?