by 90s_dev · 1y ago · 0 comments
- how can you use a modal editor!?
- how can you use a nonmodal editor!?
It's not that it's difficult for me, it's that it's unnatural for me.
Different people's minds work differently.
Yep, that's precisely it.
But not sure real editors are as capable since some can have adverse actions on mode changes (e.g. resetting your selection or changing undo stack etc)
In fact, I have a hard time editing in web browser textareas and Google Docs because of the muscle memory of vimlike keybindings and how I've associated them with tactile keyboards. (Smartphones and tablets don't give me this problem since they feel different, but laptop/desktop Google Docs editing throws me for a loop.)
Once you learn, modal is the way to go. It feels like playing a piano over an AST. It's so elegant for code and syntax trees.
I've been using vim keybindings in vim and vimlikes (JetBrains IDEs and VS Code) for nearly twenty years now. I learned most of it within just my first three months and have picked up additional surface area every year. I would still call myself a novice relative to vim masters, but you can get a ton of value from the basic movements and chords and occasional macros. All that to say, the learning curve might look steep, but it's shallower than you think and certainly well worth it.
The only reason I'd see non-modal being useful in a modal editor is as a crunch to learn and make the onboarding smoother. But you'd probably still want the first steps to be modal anyway, so I'm not sure it would provide much value.
Just jump in. It feels weird and slow at first, but let it grow on you. It pays dividends.
Emacs was always modal. Emacs is inherently a modal text editor - keychords are modal, transients are modal, isearch is modal, repeat-mode is modality. The only thing the idea of vim-navigation brings on top of all that is a simple, structured and memorable language/grammar to deal with modality, that's all what it is.
Both approaches are modal; Vi just codified its modality into a more learnable, linguistic system while Emacs distributed its modality across context-sensitive mini-languages.
Emacs has this same power scattered throughout - the kill-ring, rectangle operations, keyboard macros - but Vi's genius was packaging it into a coherent, immediately graspable system that feels less like using a computer and more like speaking a concise language about text.
The best thing about learning that language is that you can apply it anywhere where keyboard input is still relevant - your browser, your terminal, your entire system - e.g. you can control your music, jump between apps, navigate between windows, etc. using only the home row keys.
I guess maybe with some configuration? A lot of emacs keybindings work out of the box in most text boxes I can think of, including this one I'm typing into right now.
If the justification about VI is that it's more learnable, then that's hardly a reason for me to switch - I've already learned emacs.
Although I do think it's a stretch to call it "immediately graspable"
Some Google Docs <=> markdown buffer as a modal editor feature (or a plugin) would be cool.
I used to use modal tiling window managers on Linux, but since window managers are always second class on Mac/Windows, that never stuck either. I bounce around too frequently for it to work. I just suffice with tmux for now.
I was pleasantly surprised to find Discord's `s/search/replace` supported as an actual feature, though having it limited to just the last message is a bit limiting.
Bro, you have no idea - vimium-c is absolutely amazing, I just can't really imagine my life without it. Toggling tab pinning and muting, moving tabs, grouping tabs, quickly finding a tab, extracting a tab into a window, joining windows, etc. - if you even try doing all that without modality, you'd have to keep learning new keybindings and memorize them.
The worst part of that is that keybindings would change. For me - font size change on a browser page works the same way as in my editor, and the terminal, and it is the same in every browser that vimium supports.
You basically need to ask yourself if you really want to keep learning and memorizing various, sometimes absolutely unrelated and difficult to reach key bindings that almost invariably require you holding modifiers, sometimes wasting your mental energy on subtleties between ctrl/alt/cmd/shift+key or you'd rather sit down, spend some time and take a systematic approach that will make your life so much easier.
> window managers are always second class on Mac/Windows, that never stuck either.
I don't use Windows much, but Yabai for Mac is really good. I've procrastinated on trying it for a long time, when I finally tried, it took me literally fifteen minutes to start. Then I hooked up my Hammerspoon config and added some key bindings. I'm very happy about it. Like for example, I've been so annoyed by Zoom that always scatters its windows around all my monitors, now I have "group Zoom windows" feature, and it's really nice.