dwyl / learn-vim

💻 Learn how to use the Vim (or Helix!) text editor to write/edit code *much* faster and get more done in less time! ⏳❤️ ✅
9 stars 0 forks source link

How to Map `Caps Lock` (⇪) key to `Esc` on `Mac`? #28

Open nelsonic opened 1 year ago

nelsonic commented 1 year ago

I almost never use the "caps lock" key on my Mac. I know @samhstn re-mapped his Caps Lock to Esc back-in-the day: https://github.com/samhstn/my-config#karabiner-elements because it was faster to use than reaching for Esc when using Vim ...

But rather than installing a key-biding/modifier program like Karabiner, I want to understand how to do this natively (and document the steps...)

So I'm looking up how to do that now: https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_macOS

nelsonic commented 1 year ago

Open System Settings > Keyboard > Keyboard Shortcuts > Modifier Keys

or just search for "Modifier Keys" in the System Settings search bar:

mac-keyboard-settings-search-for-modifier-keys

That will bring up a modal that allows you to re-map the keys:

image

Find the "Caps lock () key" and select the dropdown/selector then chose "Escape":

image

When you click "Done" the changes you made will take immediate effect...

nelsonic commented 1 year ago

ah .. derp. scroll up to those previous screenshots ... see if you can spot a difference to this one:

image

yes, the "Select keyboard" was set to "USB Receiver" ...

image

Had to select "Apple Internal ... " for it to work!