I'm thinking of something altogether different: you leave the editor alone and you script the operating system around it, using the editor only as a flexible control interface for everything. This is the original vi philosophy. It means you don't have to rewrite anything. Any new program you install, if it can send/receive text on STDIN/STDOUT/STDERR, then you can use it in vi.
So what's wrong with vi? It has a few shortcomings: no unlimited undo, no ability to pass the cursor (row,col) position to an external command, and working with multiple buffers is more painful than it needs to be.