31.15 Fooling vi into Allowing Complex Macros
vi wants undo to work for macros. Unfortunately, vi 's undo is very simple. Rather than allow complex macros to break undo, vi disallows complex macros. I believe this is a big mistake. I'd much rather give up undo than powerful macros.
Fortunately (for those who want real macros), the code that figures out whether a macro will break undo is "very" broken.
For instance, throwing in an
Likewise, breaking a single macro into multiple macros that call each other can also fool vi . For example, to do one complex macro, I define:
map X "bY
and then use:
So what does it mean that you get the message
So rise up. Tell your UNIX vendor that you're tired of being coddled like an MS-DOS user! If you intended to undo that macro, you wouldn't have executed it in the first place. Don't let meddling johnny-come-lately UNIX vendors destroy the venerable screw-the-user tradition that has made UNIX great. Make them put it back the way it was.