VIM Smart quit macro
问题 From years of "finger memory" my hands know that F2 is save and F3 is quit (leftovers from years of IBM editors). Consequently my first vim key mappings were to get F2 and F3 doing what they're supposed to do. In particular for F3: :map <F3> :q<CR> :map! <ESC>:q<CR> If I quit a file that has edits I still get the E37: No write since last change (add ! to override) . What I'd prefer is more a function that would emit E37: No write since last change. Press F3 again to really quit.) How would I