Previously. Besides modal editing and customizability, another core aspect of Vim’s power comes from composability. For example:
dt:deletes until the next
d2wdeletes two words
cibdeletes inside the current bracket and insert insert mode from there
>10jindents the current line and the next 10 lines
This mechanism offers significant flexibility while minimizing the amount of key presses.
Table of Contents
With most of the infrastructure work finished in the previous two episodes, I thought implementing these actual features would just be a tedious part that I have to go through. However, when I was thinking about boolean flags like
expect_movement and trying to nest yet another level of switch-case, I had a feeling of déjà vu.
Am I just building a parser? By hand? With switch-cases and boolean flags?
That’s correct, I was trying to build something that can construct a tree structure from a linear input (keystrokes) so I can write cleaner execution logic. In other words, a parser.
Work in progress.