upvote
Curious to hear your gripes about modal editors! I'm a long time Emacs user (traditional keybindings, not evil-mode), but I also started using Vim in parallel a little over a decade ago. I feel very proficient/productive in both, regularly using many of Vim's more advanced motions and functionality. I generally love the power and composability of Vim text objects, and definitely experience the benefit of using them. But there are some times where I am doing things like many small edits within a line where rapidly changing modes for all of the edits starts to feel cumbersome.

For Emacs, I use multiple cursors and a treesitter-based plug-in for incrementally expanding or reducing the selection by text objects. I also have a collection of my own helper functions for working with text that make my non-modal Emacs approach still feel very comparable to the power of manipulating text in Vim.

Curious to hear if your issues with modal editing are similar.

reply
- It feels like I know all the efficient keybindings, but when someone looks over my shoulder, I become conscious of how much time I spend mashing Esc/CapsLock and i/I/a/A/o/O, compared to how much editing actually happens.

- I have nomouse mode on, to try to learn modal editors properly. But the mouse is actually fairly fast for getting to a specific cursor position. In theory, using Helix motions could be faster (and there's gw if I don't know what motion to use). In practice, the mental process of turning a point on the coordinate plane into the correct series of motions (including i) feels vastly slower.

Still, Vim, Helix, etc are incredible for structural manipulation of text, and I miss what they provide any time I edit text somewhere else, even with the universal keybindings that are available for navigating/selecting/deleting words, lines, etc. I tried Vim mode in Zed and it just didn't cut it.

Some things about Helix that I particularly like: speed and stability (no weird lag on visual block insert!), the jump to diagnostics/changes pattern (]d <Space>a is a surprisingly nice spellcheck interface, with <Space>d for the overview), the jumplist, and the good-by-default fuzzy pickers.

reply
deleted
reply
My main gripe with modal editors is that they still use the Escape key to go back to normal mode even though Escape was chosen for historical reasons (used to sit much much closer to the home row on older Unix Keyboards) In Linux and MacOs I can change it with just one gui setting but it's still annoying how everyone went with it. It's not mentionned in most vim tutorials. According to a vim reddit poll, at least half of the users are just using Escape where it is now instead of one of the alternatives. This is beyond me, it feels like someone inventing glasses in order to see better but everyone settled on cast iron frames.
reply
Cassepipe, it’s not a great default for sure. What do you have yours mapped to? I mapped jj to return to normal mode and also save my file. So, as I’m typing, I just hit jj, the jj vanishes, and this command is run:

<Esc>:w<CR>

I could just have it escape instead without saving.

If I hadn’t chose jj it would have been ff, which is also always under an index finger. I do wish I’d been clued into the idea when I started with Vim instead of two years later.

reply
I find the jj/jk hack a bit too clever for my taste. I just map CapsLock to Escape system-wide because it also unlocks quick escaping for shells vi-modes too and I realized that actually Escape is a really nice key to have around in a lot of UIs to get out/go back/cancel what you are doing. I also like that it's a simple gui setting away (or registry key editing in windows).

I either put CapsLock where Escape sits or use both shifts simultaneously (one cancels it) but even then I almost never use it. The rare times I need to type a lot of uppercase together is generally code in vim and visual selection + gU does the job.

The point of my comment was not to shill for a particular solution though but for the vim community to acknowledge the problem publicly instead of it being some insider knowledge you discover in a random internet comment six months into fighting vim (if you haven't dropped out yet)

reply
What key would be a good candidate as a default though? Imagine the memes for exiting vim if you needed a modifier to get into normal mode. Caps lock is truly a useless key and should be escape anyway.
reply
As someone who cut their teeth on a sun "programmer" layout, I really need control to be in that position. I might try mapping the vestigial control key to escape though. Or maybe the hack that dtj1123 describes (tap is escape, hold is control), if I can pull that off on macos.
reply
<ctrl-[> always works out of the box which is less of a stretch than esc.

I do jk as I always find a roll easier on the fingers than a double-tap jj or kk. You could also use space provided you aren't using one of those distros that bases its identity on the spacebar.

reply
Yea for me capslock is a systemwide esc for me. Works great.
reply
I map caps to ctrl and do ctrl-[ to get to normal mode. The main reason is using Vim bindings in other editors where Esc can get intercepted by other bindings but ctrl-[ has always worked everywhere.
reply
My opinion is that going back to normal mode is too important a key to be a key combo, and a weird one at that (is it [ or ] ?). I am pretty sure you can get used to it but we humans get used to anything really, doesn't make it good. My pressing on CapsLock happens at a subconscious level. Quick edit and then punctuate with CapsLock with the pinkie. Some random key combo is not acceptable.

But again my point is that the default sucks. You probably learned a about Ctrl + [ while looking online for alternatives after realizing the default sucked

reply
at least on linux you can map caps lock to esc if tapped and ctrl if held
reply
I have caps remapped to esc when tapped, and ctrl when held. Takes perhaps a weekend to get used to, but once the muscle memory is there it feels incredibly comfortable and natural.
reply
Which tool can do that kind of wizardry? I've seen either but not both.
reply
I have similar types of bindings. I just found a keyboard that can use ZMK. There's quite a few out there.

ZMK (or it's free software cousin QMK) are super flexible and you can create lots of custom behaviors for keys (tap/hold behaviors, double press, layering, etc...). It takes some time and effort to learn how to set it all up. Some of the more complicated behaviors require using their dsl for mapping the keys instead of their GUI editor. Considering the ridiculous amount of hours I spend at my computer using a keyboard, I felt it was worth the investment in learning.

reply
On macOS I use Karabiner-Elements to do the exact same thing. Also, my config is only applied in terminals, everywhere else the original functionality is kept. So, I'd say it is quite flexible.
reply
Is this macro mapped in vim or OS level? Sounds interesting.
reply
Last time I checked, on all OSes you need to install some third-party software alas. Hopefully I am wrong now.
reply
deleted
reply
I configure it in the firmware of my keyboard with QMK
reply
I have hesitated many times to set this up but I don't want to get used to something that I cannot set up in less than 30 seconds on a new machine.

Not having Escape where CapsLock sits on a new machine already makes it infuriatingly unusable already :)

reply
I mean... if people don't mind reaching, so what? I purposefully don't remap my leader key, although I don't have many leader mappings so it's not like I'm reaching for it constantly.
reply
It is not good for your wrists. Don't do that to yourself
reply
I mean if people don't mind having cast iron glasses, sure

No but really, vim's paradim that you should go back to normal mode constantly. With the current situation you get posts on the vim subreddit asking/telling you about insert mode editing commands. You might as well use Emacs at that point, at least it would be the intended workflow

reply