Locally defined coa and cot should work like their counterparts in
unimpaired.vim, where the actual command is echoed on the status line
rather than a human readable description of what happened. This is
great for consistency but also good for informing the user what these
commands actuall do.
let tmp = substitute(&formatoptions, 't', '', '')
if &formatoptions == tmp
set fo+=t
- :echo "Enable text wrap"
+ :echo ":set fo+=t"
else
set fo-=t
- :echo "Disable text wrap"
+ :echo ":set fo-=t"
endif
endfunction
let tmp = substitute(&formatoptions, 'a', '', '')
if &formatoptions == tmp
set fo+=a
- :echo "Enable auto-wrap paragraphs"
+ :echo ":set fo+=a"
else
set fo-=a
- :echo "Disable auto-wrap paragraphs"
+ :echo ":set fo-=a"
endif
endfunction