|
|
|
Opinion: Structural editing is superior to the Vim grammar
|
|
5 points
by rishflab
1443 days ago
|
|
I tried switching from jetbrains to various modal editors (neovim, doom-emacs, kakoune, helix).
The fast startup time and continuity when working in a terminal environment was very appealing,
as was the promise of increased code editing effeciency. I liked the fast startup time and having the same keybindings to edit system config files but
I am not impressed with VIM style text editing. First of all programmers don't really edit text,
we edit code. VIM's grammar does not acknowledge this. It is centered around lines, words etc.
Code is a tree. A grammar/keybinds designed around traversing, selecting and modifying this tree would be superior for editing code IMO. Of course I can install tree-sitter and setup structual editing based bindings but am I really
using VIM at this point? I don't think the VIM grammar is the future of code editing.
I think it is a bit overrated. I think editor designers should work on developing a grammar/keybinds
that center around structural/tree based editing.
I have found that IDE's tend to acknowledge this tree based
"reality" better than VIM. I think this concept could even be applied to source control ie. git stores an tree-sitter like
representation of code instead of text. Your text editor handles formatting. |
|
> Of course I can install tree-sitter and setup structual editing based bindings but am I really using VIM at this point?
Why would this mean that you are not using Vim?
You are using Vim with a Vim extension that gives you better keybindings. That extension happens to pull in Tree-sitter, in the same way as Atom would. But your setup is faster and consumes much less memory.
Or to put it differently: Vim and Emacs both link to libpcre for regular expression parsing, but that doesn't mean that if you use regular expressions in Vim, you are using Emacs.