News for hackers. Stuff that matters.
Re:The MacBook keyboard fiasco is way worse than Apple thinks by djtriptych on Tuesday April 02, 2019 @10:31AM (#19554454)
I map caps lock to control OS-wide.

And I'm trying to train myself to use jj instead of ESC.

But still. I miss my ESC / hardware volume / hardware brightness buttons etc.

Re:The MacBook keyboard fiasco is way worse than Apple thinks by qubitcoder on Tuesday April 02, 2019 @04:14PM (#19558120)
I also map caps lock to control OS-wide on both macOS (Preferences > Keyboard > Modifier Keys) and on Linux (using gnome-tweak-tool).

Instead of using jj or escape in Vim/Spacemacs, I just use control+[.

With caps lock mapped as control, it's a single fast motion--left pinky to caps lock, and right pinky to [. I've been using this setup for years. It's one of the first things I setup on a new computer/OS.

Mapping caps lock to control also has other benefits. You can quickly zip around the terminal using control+a/e/k/y/d/r etc. As an added bonus, the same keyboard shortcuts work equally well on both macOS and Linux [1].

[1] https://www.ostechnix.com/list-useful-bash-keyboard-shortcut...

Re:The MacBook keyboard fiasco is way worse than Apple thinks by aquamo on Tuesday April 02, 2019 @12:32PM (#19555914)
On my 2016 MBP, I also map CapsLock -> Control and Left_Control to ESC. It's goofy having ESC down there but I need a physical key as I do not look at the keyboard while typing in vim - there is no haptic feedback from the glass surface.

I am 50/50 VIM / EMacs so the it's important for my control key to be on the home row.

I'm not sure why keyboards even have caps lock. It's rude in chat right :-) I started with Sun keyboards where control was on the home row. I guess if one spends hours typing long capitalized acronyms daily, then it makes sense.

It's personal preference in the end. I certainly wont buy another MBP - my 2016 has had 4 trips to the Apple store since I bought it for key replacements.

Re:The MacBook keyboard fiasco is way worse than Apple thinks by AdieuToLogic on Tuesday April 02, 2019 @03:03PM (#19557502)
As I mentioned in another comment, you can use Control-[ to produce ESC in programs which respect ASCII control character values. So this will work with vim and emacs, but likely would not work to simulate depressing a cancel button in a GUI.

Personally, I prefer the Control-[ combo as it allows me to slide my left pinky slightly from the home row and right pinky 45 degrees up and right to produces an ESC. Over the years it has made having to hunt for a physical ESC key quite irritating for the few programs which require it :-).

HTH

Re:The MacBook keyboard fiasco is way worse than Apple thinks by apazzolini on Tuesday April 02, 2019 @11:13AM (#19554960)
Give Karabiner a shot - it can map caps lock to ESC on press and CTRL on hold.
Re:The MacBook keyboard fiasco is way worse than Apple thinks by dguo on Tuesday April 02, 2019 @11:29AM (#19555167)
I do this on every machine I use. I wrote a blog post with detailed instructions: https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-...
Re:The MacBook keyboard fiasco is way worse than Apple thinks by tasuki on Tuesday April 02, 2019 @11:27AM (#19555136)
I never understood why people would want to press the same key twice to get to normal mode. Here's what I use:

  " j + k = normal mode
  inoremap jk <esc>
  inoremap kj <esc>
And yes, it does happen that I want to enter jk or kj and it exits the insert mode. Usually when pasting something and not more often than about once a month. `:set paste!` to the rescue.
Re:The MacBook keyboard fiasco is way worse than Apple thinks by degrews on Thursday April 04, 2019 @10:56PM (#19579259)
I also recommend jk or kj over jj. Much faster and less strenuous.

And it has the added benefit that, if you type it when already in normal mode, it's effectively a no-op (as opposed to jj, which will move the cursor two lines down).

Re:The MacBook keyboard fiasco is way worse than Apple thinks by AlexandrB on Tuesday April 02, 2019 @11:39AM (#19555284)
Try Ctrl+[

With caps lock remapped to Ctrl its easy to reach from the home keys and requires no Vim configuration.