| (Yes, I'm crazy, I know.) So, I'm somewhat okay at programming, with an early-intermediate level of proficiency in Python and C++ by now. I'd like to know what it would take to rewrite Vim from scratch, with the long term goals of adding in all the sweet Emacs stuff (like integrated scripting and the like) as well as things like an integrated package manager etc. What things would I need to teach myself? Bear in mind that I do not have much real programming "experience" (as in, I've only written <5K LoC stuff, no real "applications" of even comparable scale). I am aware of NeoVim, please don't simply point me to it :)
Think of this as a stupid personal project, if you will (although I do plan to put this on GitHub and am open to collaboration if it gains any momentum). It doesn't need to be compatible with Vim at all. |
Time, mainly. Computers these days are fast enough, and have enough storage space that writing Vim will be mostly straight forwards.
The first thing to do, as is for all software, is to make a spec and a roadmap. The doesn't have to be anything too serious, hell, you don't even have to write it out if you don't want to - this is your project after all. (But writing thing down is highly recommended.)
Your spec and roadmap, whether just a notion in your head, or a multi-page written out document with pictures and graphs, should talk about every single feature you want, then break those down into milestones and then break those down into smaller and smaller steps, until they're small enough that you can just start coding (or start googling for the right library)
> What things would I need to teach myself?
Well, you say you know Python and C++. Both are valid choices to write HunnypotVim in; it's your project, so pick one or the other (or a combination of both if you're feeling masochistic). Whatever you chose, you'll need to teach yourself various libraries and their API for your chosen language.
Next, you'll have to decide if you want to make a terminal program, or if you'd rather write a GVim style GUI editor. If you chose a terminal program, you'll need to learn ncurses; a GUI program will need a GUI toolkit, such as QT. Ncurses will have the 'getch' single-character input reader that you'll need in order to reimplement Vim.
You'll also need to learn how to parse command line arguments and file IO.
I'd probably start with a trivial command line argument parser, then move onto basic fileIO before starting in on the ncurses frontend development. Implement normal mode, then hjkl movement keys, finish up with a basic insert mode, and you've got your basic Vim clone!
Additional features left as an exercise for the reader ;)
My email's in my profile if you'd like to discuss this further.
Good luck, and happy coding!