News for hackers. Stuff that matters.
Re:LazyVim by p-e-w on Monday July 17, 2023 @02:57AM (#36754967)
> Was that expressly written to parody Vim?

Yes. The advice to turn the yoke upside down is supposed to reference remapping Caps Lock to Escape, without which Vim destroys your pinky on a standard keyboard. But it's the choice of professionals, so what can we do?

Re:LazyVim by divbzero on Monday July 17, 2023 @03:06AM (#36755016)
Nice, I didn’t pick up on that one. And yes I do have Caps Lock mapped to remapped to Escape haha.

If any vim enthusiasts haven’t read this history before, this article [1] provides a good overview of how ex/vi came to be. The photo of the Lear Siegler ADM-3A keyboard used by Bill Joy largely explains the odd choice of keys.

[1]: https://twobithistory.org/2018/08/05/where-vim-came-from.htm...

Re:LazyVim by cayley_graph on Monday July 17, 2023 @03:04AM (#36755005)
I'm playing into the joke here, but on most terminals, alt + <key> will actually be sent to the program as <esc> + key. You can use this to avoid pressing escape in Neovim.
Re:LazyVim by xeyownt on Monday July 17, 2023 @03:49AM (#36755288)
Interesting tip too! Need to find the right combination however, I noticed that Alt-L might be a good one (no side effect it seems).
Re:LazyVim by greggyb on Monday July 17, 2023 @07:58AM (#36757087)
That will move your cursor to the right by one character after exiting insert mode.
Re:LazyVim by cayley_graph on Monday July 17, 2023 @08:08AM (#36757203)
Entering + exiting insert mode with i and Esc moves your cursor to the left by one, so I suppose this neutralizes it?
Re:LazyVim by madsr on Monday July 17, 2023 @06:55AM (#36756438)
+1. I mainly use this approach. If your next intended move is to go to the next line, Alt-J will exit insert mode and go to the next line immediately. Also the same for Alt+w/W/b/B, Alt+o, Alt+0, etc etc and it's just a matter of using your left thumb at the same time as navigating.
Re:LazyVim by arghwhat on Monday July 17, 2023 @03:16AM (#36755090)
Trick for those wanting caps lock to be compose instead: ctrl-c also works as escape, and has historically been slightly faster due to sidestepping the escape timeout.
Re:LazyVim by xeyownt on Monday July 17, 2023 @03:48AM (#36755278)
Wow super useful, didn't know that.

Note that however crtl-c and esc are not strictly equivalent: if you do esc or ctrl-c, the position of the cursor when back in normal mode will differ. You can see this if you do insert then esc repeatedly, seeing the cursor moving. Cursor doesn't move with ctrl-c (which somehow I prefer).

Re:LazyVim by marcusramberg on Monday July 17, 2023 @06:03AM (#36756100)
I've remapped caps lock to ctrl with chords and escape when clicked alone. Feel it's the best of both worlds :)
Re:LazyVim by xigoi on Tuesday July 18, 2023 @07:29AM (#36770641)
<c-c> is not completely equivalent to <esc>. For example, 50i=<c-c> will insert only one equals sign.
Re:LazyVim by stavros on Monday July 17, 2023 @03:08AM (#36755027)
But remapping Caps Lock to a combination Ctrl/Esc is so convenient, regardless of Vim!
Re:LazyVim by dmi on Monday July 17, 2023 @04:54AM (#36755686)
I've been using Ctrl-[ instead of Esc for so long that I forget that a lot of people don't know about it. This may not be convenient on non-English keyboard layouts.

More alternatives: https://vim.fandom.com/wiki/Avoid_the_escape_key

Re:LazyVim by mvanbaak on Monday July 17, 2023 @06:19AM (#36756192)
small fun fact: I switched to this when the escape key was taken from me (thanks again NOT apple) After switching to a newer MacBook that has the escape key I did not start using that again, but stuck to the Ctrl-[ as it just works.
Re:LazyVim by metaltyphoon on Tuesday July 18, 2023 @01:13AM (#36768084)
Better yet, remap CapsLock to Ctrl.
Re:LazyVim by eptcyka on Monday July 17, 2023 @05:06AM (#36755746)
What about control+c? Also, I've never used vim without remapping `jj` to <Esc>.
Re:LazyVim by distcs on Monday July 17, 2023 @05:09AM (#36755768)
Ctrl+C and Esc do not behave the same in all contexts. The correct replacement for Esc is Ctrl+[.

What if you need to type `jj`? Not uncommon to do so while writing math or physics papers. a_{jj}

Re:LazyVim by sidibe on Monday July 17, 2023 @06:26AM (#36756244)
Spacemacs defaults to fd, I don't think I ever accidentally left insert mode with that.

Happy vscode user these days. If I find myself fiddling with an editor it's a huge red flag to me that I hate what I'm working on.

Re:LazyVim by turboponyy on Monday July 17, 2023 @06:57AM (#36756448)
fd sounds much worse as now you can't jump to d characters.
Re:LazyVim by gsinclair on Monday July 17, 2023 @07:26AM (#36756679)
False. The fd mapping would only apply in insert mode. Jumping to d only occurs in normal mode.
Re:LazyVim by turboponyy on Monday July 17, 2023 @08:03AM (#36757147)
Oops - you're correct, of course.
Re:LazyVim by distcs on Monday July 17, 2023 @08:17AM (#36757316)
I still don't understand how these mappings are good.

What if you need to type "fd" in insert mode? Like fd0, fd1, etc. Isn't that going to be a pain? Do you never have to type "fd"?

Re:LazyVim by wzdd on Monday July 17, 2023 @08:44AM (#36757541)
There is a timeout on multi-key mappings, so if you need to type fd0 you type f, wait 'timeoutlen' (1 second by default apparently), then type d0.

That's a pain, but it doesn't come up often. In return you get quite a lot of functionality (due to vim being modal) without having to move your fingers beyond the letter keys, which is quite relaxing.

Re:LazyVim by eptcyka on Tuesday July 18, 2023 @11:31AM (#36774120)
Having fiddled with file descriptors, I could never live with such a remap. To each their own :)
Re:LazyVim by krab on Monday July 17, 2023 @08:30AM (#36757430)
Not using this personally but there can be a timeout, or you do jk<backspace>j. Fine if the letter sequence is rare enough.
Re:LazyVim by themadturk on Monday July 17, 2023 @11:08PM (#36767337)
Type "jj" a little slower if you don't want it to be <esc>, it works fine.
Re:LazyVim by roland35 on Monday July 17, 2023 @06:59AM (#36756461)
I think jk is a bit easier to type but they both work well!
Re:LazyVim by dbalatero on Monday July 17, 2023 @08:39AM (#36757496)
Not sure why you're getting downvoted, repeating the same key with the same finger is slower than dropping two fingers down onto `jk`.
Re:LazyVim by tambourine_man on Monday July 17, 2023 @08:51AM (#36757636)
Aaaactually… professionals map jj to Esc.

JJ Abrams disagrees, though.

Re:LazyVim by themadturk on Monday July 17, 2023 @11:07PM (#36767327)
Depends on how fast a typist he is.
Re:LazyVim by yoyohello13 on Monday July 17, 2023 @11:31AM (#36759456)
Remapping Caps Lock to Ctrl is a life changer in any environment. Seriously, just try it. It makes a useless key actually useful.
Re:LazyVim by recursive on Monday July 17, 2023 @06:24PM (#36764899)
But I use caps lock. Sometimes.