Ask HN: The most useful Mac keyboard shortcuts?
Ones that most people don't know about, that you actually regularly use. Thank you!
Edit: "Not a shortcut exactly..." tips are most welcome too.
Edit: "Not a shortcut exactly..." tips are most welcome too.
139 comments
[ 2.8 ms ] story [ 175 ms ] threadI own a similar app called Witch[1] from Many Tricks (the guy behind Moom). Also a nice Cmd+Tab upgrade.
[1] https://manytricks.com/witch/
So much easier in terminal and for using shortcuts like ctrl-A & ctrl-E for beginning and end of line, etc.
I use it for both Caps Lock -> Escape/Control and Return -> Return/Control and it's indispensible.
FWIW, Ctrl-[ emits the ASCII code for ESC. So you can save that 'vim pinky' and have the remainder of control codes available to you as well :-).
On Linux you can get it to do the same thing with a combination of xmodmap, setxkbmap and xcape (but it's fiddly) and on Windows with AutoHotkey (but it's fiddly) — neither are as easy to use as Karabiner Elements, but they do work.
It's better to use a full size keyboard and use two hands for keyboard combos, e.g. for Ctrl+A use right Ctrl, for Ctrl+N use left Ctrl, for Ctrl+E use right control. Takes a little while to master but it puts much less pressure on your fingers.
Mapping Caps to Esc is a good choice though.
I like your Esc idea though. I know someone that remaps it to esc when pressed alone and ctrl when chorded.
(seriously) Cmd Shift 4 also has AFTERTOUCH - so do the command, draw out the grey capture window, and keep holding the mouse button WHILE trying using different combinations of Ctrl, Option, and Shift. Allows you to resize your capture window.
Without the initial SHIFT dumps the file to the Desktop. With the SHIFT adds the screenshot to your clipboard.
Shift-Cmd-3 will simultaneously capture a screenshot of ALL monitors connected to your system and put the files on the Desktop.
Shift-Cmd-4 will give you a cursor with which you can draw a rectangle of the area desired; if you then hit Space, however, the cursor changes to a camera icon which then allows you to click on any open window. That window will then be captured.
Shift-Cmd-5 pulls up a full set of screen capture controls with various options.
Control-cmd-F makes most apps full screen (or toggles back)
^k, ^y, etc...standard text widgets accept basic Emacs commands.
Suggests your experience with Apple computers dates back at least to the '80s! :-D
And Karabiner Elements (https://github.com/tekezo/Karabiner-Elements) to remap keys to something more useful (who uses Caps Lock anymore?)
It's really nice to use k for "(" and l for ")". I don't have to reach up two rows.
It looks like someone else is currently working on a Swift rewrite. https://github.com/rxhanson/Rectangle
> Spectacle used it's own keyboard shortcut recorder, while Rectangle uses MASShortcut [1], a well maintained open source library for shortcut recording in macOS apps. This cuts down dramatically on the number of bugs that were only in Spectacle because of the custom shortcut recorder.
[1] https://github.com/shpakovski/MASShortcut
https://github.com/ianyh/Amethyst
Then command-e, command-g (find next) will search for the selected text without sacrificing the copy/paste clipboard.
Also, the find clipboard is shared between apps, so you can command-e in Safari, then command-g in Xcode.
Works fine on Firefox. I'd say breaking it is a Chrome thing.
Not exactly a shortcut, but I once made a gesture-driven shortcut app (https://thimblemac.com) - it’s been on hiatus the past couple years but have been wondering if there’s value in it for programming work contexts.
Did you remap that key combo?
cntrl+p: go up one line
cntrl+n: go down one line
cntrl+k: cut line proceeding cursor
cntrl+f: forward one char
cntrl+b: back one char
These work everywhere you can type text on Mac: including in this HN text box, in the url bar, etc. I absolutely love these shortcuts...
aka Emacs keybinds.
> These work everywhere you can type text on Mac
Supposedly they even work on iOS if you plug in a keyboard, which is pretty unexpected if you think about it.
Code https://github.com/i386/plainjane
I map it cmd-shift-v and I can bounce between all of my most recent clipboards. Saves so much time.
https://github.com/Clipy/Clipy
Alfred supports images, rich text and a few other mime types for its history.
Key commands generated to follow any link on the page. It makes browsing really efficient.
"Go to the folder:"