Which is what writing vim script essentially is. Or if vimscript is not enough, you can use literally any other language and integrate it via vimscript. I'm not an expert though but I have spent quite a lot of time on doing that.
I get that ViM is really powerful, so is Emacs and the like, however I'd guess a large part of going into the trouble of building your own text editor would be to learn about the algorithms and data structures used, something you can't do by writing ViM configuration files.
Well - not to be needlessly contrarian, but I've programmed that way (vim with nothing except what's included) for nearly 25 years now... it already has everything you need.