A MS Word template to give Vim-like functionality to your document.
- I developed this entirely within the Word VBA-IDE. So, my commits are gonna be random and likely just overwrite raw code (I'll try to keep it in two vba modules).
- I used AI to generate some code, but it all sucked, so I just got some ideas from it. Problem was that it didn't really play well with legacy stuff like VBA - which is what I taught myself to code on so I just found it to be easier to do from scratch.
- Run at your own risk - check code first to ensure you'd be happy with it. I didn't put anything intentionally volatile in, but don't trust me - my first commit comprised about 4 hours scrappy work.
- Create a new MS Word doc.dotm.
- Alt + F11 to open the vba ide.
- In the "ThisDocument" for the dotm file, paste the raw code from the commit.
- Right click and create a new module named "vBinds".
- In vBinds paste the vBinds raw code commit.
- Set a Quick Access toolbar thing to launch the togglevimba macro.
- NOTE!!! If you are doing this (Don't know how you found this code tbh), early breakages will mess with actual keybinds. Run the toggle macro a couple times to clear keybinds or create a new QAT toggle to specifically clear keybinds - note the TODO about it nuking all keybinds.
- Fix ClearBindings to only clear Vimba keys - Currently nukes all Word keybindings. Track in a collection?
- Unify buffer system architecture - Decide whether operators go through : buffer or have their own flow. Current d vs :w conflict will probably break things as more are added. Want to keep it vim like, so buffers for numbers and other actions.
- Implement ESC in buffer mode - Right now no way to cancel a buffer command.
- Fix the count/number system foundation - count prefix that ANY command can use. [affects every future motion/operator]
- Consolidate mode management - ThisDocument / vBinds Module for all mode logic. Split ownership is causing some headache.
- Add operator-motion grammar parser - Need logic to handle [count][operator][count][motion] pattern properly. Required before adding more operators.
- Add basic yank/put (y/p) - Core editing. Affects whether you need register system later.
- Fix case sensitivity bug - localKeyK types "K" instead of "k"
- Bind and implement a command - You have the function, just bind it.
- Complete basic motions - 0, $, ^, gg, G for line navigation
- Add insert mode variations - A, I, o, O for different insert positions
- Implement visual mode entry - v key, then make motions extend selection
- Add undo/redo - u and Ctrl+R bindings
- Implement line-wise operators - dd, yy, cc (operator pressed twice)
- Add search - / and n/N for navigation
- Implement text objects for operators - diw (delete inner word), da( (delete around parentheses). This is what makes Vim powerful, affects how you design operator logic.
- Add change operator - c to delete and enter insert mode
- Command history tracking - needed for next item.
- Implement dot command (.) - Repeat last action.