Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: The most useful Mac keyboard shortcuts?
122 points by yesenadam on Aug 6, 2019 | hide | past | favorite | 135 comments
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.

Command-e, put the selected text on the find clipboard.

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.

Get Alfred. Clipboard history will change your life.

I've been using Copy'em Paste but Alfred looks like a beast.

It is a beast. If you are a dev you can extend it with scripts.

And eject a disk from the desktop.

Note, cmd+e seems to be a safari thing; no such luck in chrome. I just cmd+f again.

> cmd+e seems to be a safari thing

Works fine on Firefox. I'd say breaking it is a Chrome thing.

Actually, doesn't work for me in Firefox (68.0.1)

In chrome, cmd+e updates the search text, cmd+g starts the search and iterates through results, shift+cmd+g goes backward through the results

Spectacle (https://github.com/eczarny/spectacle#keyboard-shortcuts) will change your life with better/faster window management.

And Karabiner Elements (https://github.com/tekezo/Karabiner-Elements) to remap keys to something more useful (who uses Caps Lock anymore?)

Spectacle is great but abandoned. It hasn't been updated in years. Bug reports and PRs are piling up.

It looks like someone else is currently working on a Swift rewrite. https://github.com/rxhanson/Rectangle

There's Amethyst as well, which generally works really well, it's been basically the first thing I install on a new Mac for years now


TIL. I should check out 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

I use Karabiner to map symbols to the home row with a Caps Lock modifier.

It's really nice to use k for "(" and l for ")". I don't have to reach up two rows.

FWIW, I use the Double Use Shift for parantheses. Tap left Shift for (, tap right Shift for ), and shift works as usual for normal typing and shortcuts. Karabiner is really an essential tool for me, especially this shortcut.

Oh wow. That's a really good one. Never thought about shift taps.

Iirc you can remap capslock in OS X settings, don't need an addon for that. Thought I'm sure Elements does a lot more than just that.

I used Spectacle before but switched to Magnet now (https://apps.apple.com/ch/app/magnet/id441258766?l=en&mt=12). It's basically the same.

For window management, I'm a big fan of Slate (https://github.com/jigish/slate). So powerful and customizable. Works great with Mojave.

Cmd+shift+/ - brings up help search to search through menu items. Huge feature to me over windows, Linux-based desktop environments.

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.

Cmd+shift+/ doesn't work in any app I'm running. Did you set that up yourself?

ditto. no worky in chrome, vs code. In slack, it brings up emoji (which is pretty neat!). In Notes, it centers text.

OP grandparent meant CMD-?, and ? happens to be SHIFT-/ on US and international keyboards.

It works in every single app that I'm running.

Did you remap that key combo?

Nope, just checked my keyboard shortcuts and it's not listed.

Holy, this is really good. I have been using an extension on alfred for this purpose, now I can get rid of it. Thanks!

Not a shortcut exactly, but remap caps lock to ctrl.

So much easier in terminal and for using shortcuts like ctrl-A & ctrl-E for beginning and end of line, etc.

Always the first thing I do on any new system. Caps lock is the most useless key in the most prime real estate.

I found mapping Caps to Ctrl caused too much RSI.

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.

It also makes it easy to use Ctrl-[ instead of reaching for ESC, which as a heavy Spacemacs and iTerm user is a lifesaver for me.

Or to esc. Saves my vim pinky a lot of grief.

> Or to esc. Saves my vim pinky a lot of grief.

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 :-).

I forget what the tool was, but I recall someone mentioning they mapped CapsLock to ESC when tapped, and to Ctrl when held.

It's Karabiner Elements on the Mac.

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.

If you have a touchbar remap it to esc. I swapped my MBP for an air but kept the remapping.

with Karabiner, you can make it so that a tap of caps lock emits an escape, while still being able to use it as a ctrl modifier when pressed in conjunction with other keys: https://pqrs.org/osx/karabiner/document.html#configuration-c...

I don’t think karabiner elements supports that and I believe that the old karabiner no longer works with current versions of Mac OS

The latest version of Elements has supported this for several months, if not longer (I think they'd made it work for High Sierra at least, but I could be wrong about the exact timing.)

I use it for both Caps Lock -> Escape/Control and Return -> Return/Control and it's indispensible.

This is brilliant

Cmd-space Type a few characters: start or switch to an app. Just hide the dock. Keeps your hands on keyboard and your eyes where you want them to be.

Control-cmd-F makes most apps full screen (or toggles back)

^k, ^y, etc...standard text widgets accept basic Emacs commands.

Cmd-Space for me is the most powerful one! It makes life so much easier, and unlike the windows key, it's all front and center on your screen and easier to read.

Four finger swipe on keyboard slides between full screen apps (or spaces)

You mean on a trackpad?

Yes, sorry, that’s what I meant.

In Finder, Command-Shift-. (period / full stop) will show hidden files.

cntrl+a: go to start of a line

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...

IIRC, these are enabled by default if the text view is a standard NS* text view (don't recall the actual class). It's always a bit of a surprise when I find a window where these don't work, and that's a good indication that someone has implemented their own class for the text view. Little nugget holdover from those Unix-loving NeXT devs.

You missed the best one, ctrl+t: swap the left and right characters adjacent to cursor. Fixes about 90% of typos.

> 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.

and cntrl+e: end of line

aka Emacs keybinds.

I was wondering why these worked everywhere. I had no idea it was a mac feature.

Shift-option-command-v: paste text without any formatting as opposed to simply using command-v

I used to sell a reasonably popular app on the Mac AppStore called Plain Jane that made that shortcut default.

Code https://github.com/i386/plainjane

Not exactly a shortcut, but https://contexts.co/ completely changes Cmd+Tab; without it I would be materially less productive

That looks nice. Is it working well on Mojave? Last update 8 May 2018, and the release notes don't mention anything.

I 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/

Was wondering the same thing, the developer indicated it does via Twitter: https://twitter.com/contextsapp/status/1138209813714821120

CMD + `/~ to switch between windows of the same app. Or if you're in the CMD Tab switcher will cycle through the list backwards.

Option-clicking on things, e.g. the wifi status symbol, will give you more detailed/different information.

If you hold down option in Xcode while cleaning the build from the menu, "Clean Build" turns into "Clean Build Folder" which applies to all targets.

In the Finder,

cmd-shift-A opens Applications folder

cmd-shift-U opens Utilities folder

cmd-shift-L opens ~/Library (might not work on older versions or if ~/Library is invisible)

cmd-shift-H opens Home folder

cmd-shift-C opens toplevel computer folder

cmd-[ "Back" button for Finder windows

cmd-] "Forward" button for Finder windows

cmd-1 changes window to icon view

cmd-2 changes window to list view

cmd-3 changes window to column view

cmd-4 changes window to cover flow view

Command-~ to switch between windows of the current program.

If you've used Cmd-C to copy something to the clipboard, pbpaste is really useful to pipe the clipboard contents into a pipe or to a file (pbcopy being the inverse)

Shift+Cmd+4 for screenshot(s)

Just to sum this all up and add some detail:

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.

Shift + Cmd + Ctrl + 4 for copying the screenshot into clipboard

OMG. This is awesome. I always open the "Grab" program but this is exactly what I should have always known. Thank you!

+space to capture a single window.

Hold option to remove the shadow

Wish this was easier to remember. I don’t do many screenshots yet I have ctrl/alt print screen burned in my brain and have to google this one every damn time

(joke ..) It's easy, just remember to add +1 from "Cmd Shift 3" .. the whole-screen screenshots shortcut.

(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.

I prefer Shift+Cmd+5

Press space afterward to screenshot a particular window with an added drop shadow.

Cmd+Shift+G, in any finder window. Go to Folder with keyboard nav, very handy.

Setting a text replacement (sys-prefs > keyboard > text) for "@@" to your email address. It's something we type multiple times a day, it's important to not have a typo, and @@ is something you rarely type in any context. This works with most apps, though some won't allow the text replacement to apply.

Cmd up arrow and cmd down arrow for navigating through folders and opening docs. I miss this so much when I using Windows.

Cmd + right or left arrow for home and end keys. I miss it so much on windows.

I like ShiftIt (free) for basic window management. I have opt+ctrl+cmd+[arrow] set to move my active window to that part of the screen. Ie, left arrow has that active window take up the left half of my screen. I then cmd+tab to another window and put it on the right side. Super quick for my window management needs.

Alfred 3's Clipboard History.

I map it cmd-shift-v and I can bounce between all of my most recent clipboards. Saves so much time.

I don't have alfred, but I've sincerely loved Clipy. Like, it totally changed how I use cut/paste:


Does Clipy support images?

Alfred supports images, rich text and a few other mime types for its history.


Alfred is amazing. I just buy every new version even if I don’t use any of the new features to give money to the dev.

You have to turn it on in accessibility settings, but ctrl + scroll to zoom in.

Mac Keyboard Shortcuts for a comprehensive list: https://support.apple.com/en-gb/HT201236

Didn't see Command + Shift + G mentioned when in Finder.

"Go to the folder:"

FWIW tab completion works in that dialog.

I remap every single key on my keyboard into custom modifier. So my caps lock is escape on single press and cmd/opt/shift on hold.

My control key is a. My command key is e. I open apps by pressing w + <key>. ie w+l opens VSCode. Press it again and it switches to previous app (under the hood w+l calls a Keyboard Maestro macro).

It’s quite awesome.


Command+? (Command+Shift+/)

Brings up the Help Viewer where you can search any menu items for the current app.

This IS pretty much the built-in command palette for all apps!

Command-<down arrow> to open the selected item in finder. A small convenience, but makes my finder usage completely mouse free.

The Contexts app makes Cmd-Tab behave like it does in Windows, switching between windows, and only ones on the current Space.

Not a shortcut exactly, but turn on the "zoom" accessibility feature bound to something like CMD. You can then zoom in anywhere on the screen by holding the shortcut and doing a two finger gesture. Useful for reading small text, checking some CSS rendering close up and to point out a feature on the screen to someone nearby.

Ctrl-Cmd-Space in most text edit fields to open the character viewer to enter emoji and other common unicode characters

Ctrl+Shift+Eject/Power: Turn off the screen; Cmd+Alt/Option+Eject/Power: Send macOS to sleep

⌘^q to lock the screen

that quits my active window. I have to cmd+ctrl+q

^ is the symbol for ctrl, sorry for the inconvenience

doh, my bad!


* command+O: open file

* command+shift+3/4/5: screenshot tool (one of the best shortcut on macOS in my opinion)

* command+alt+space: switch keyboard input source

* "=", ">", "<" "-", while holding down `option` gives you "≠", "≥", "≤", "–"


+ Safari: command+shit+\ (show tab overview)

+ FileMerge: command+D to jump to next conflict

+ VSCode: control+shift+E: toggle focus

+ iTerm2: command+] to switch between panes

+ iTerm2: command+K: clear buffer

+ Dash: command+shift+D

+ Spectacle: https://github.com/eczarny/spectacle#keyboard-shortcuts. And also, as zuccs's comment https://news.ycombinator.com/item?id=20621517

+ VSCode: CMD + b toggles the sidebar (whichever is open)

The app witch lets you command-tab to switch apps but it lets you choose any open window of any app. So if you have 4 separate terminals and 3 chrome windows and multiple word documents open you can scroll to the exact one that you like

If you have a touchbar - https://pock.dev is a huge improvement.

Cmd-tab for switching between apps quickly. Takes a few days to get really good with it.

For all those with Touch Bars - remap Caps Lock to be the Escape key

Does anyone know a way to assign a keyboard shortcut to show and hide a specific app? I love this feature in iTerm2 and would like to have it for my browser and text editor as well.

I have it set up in Keyboard Maestro. It's useful, as if you also use Keyboard Maestro's app switcher (Cmd+Tab), you can set that up to never show certain apps in the switcher - apps like Spotify and Tweetbot that I always have open, but clutter the switcher.

I'll check it out. Thanks for the tip.

Ctrl+Left and Ctrl+Right for desktop switching without using mouse.

The biggest thing I missed going from Ubuntu to Mac was the ability to take your current active window with you when you switched workspaces using only the keyboard. In Mac, you have to use a mouse. Now I only use the other workspace/desktop as a quick way to get a clear screen to access something on the desktop like a recent screen shot.

⌘⌃D -- looks up whatever word the cursor is hovering over or whatever text has been selected. Works system-wide except (irritatingly) in Microsoft Office.

CMD + SHIFT + G to navigate Open/Save dialogs with the keyboard. Supports autocomplete with TAB. Navigate multiple suggestions with UP/DOWN arrow.

Hot corners. I have top right corner as put display to sleep. So I can just walk away from my Mac at work if I want to go grab a coffee or something.

Me too! It’s a great tip

Not a shortcut exactly, but get some app that adds shortcuts to snap the current window to various presets. I use Spectacle, but there are several.

I use BetterSnapTool. Gives me the same kind of "windows key + direction" usage that I came to love when I was a windows developer.

I use Magnet, which comes with very nice KB shortcuts for window manipulation. It adds on the one feature from Windows that I missed on macOS.

Another recommendation for Magnet. Using an ultrawide with my MBP it makes snapping windows around the screen really smooth and a key part of the workflow.

Late to the party: CMD + L selects the URL of your tab. Comes in quite handy for sending URLs to people. CMD + L => CMD + C => done :)

⌘-] and ⌘-[ to navigate between items like conversations in messages or Slack. Seem to be a fairly de facto shortcuts.

Vimium browser extension.

Key commands generated to follow any link on the page. It makes browsing really efficient.

Cmd + Shift + F3 is one that I'm using periodically. This will show your desktop (files).

Esc. I spend most of the time on chrome and esc key can close most of the annoying popups.

Late to the comment party, hopefully this still helps someone!

Probably the most important knowledge is to learn the Mac modifier key symbols, since they'll help you learn more shortcuts from the menu items you use.

⌃ Control ⇧ Shift ⌥ Option ⌘ Command


[⌃⇧⌘4] Copy screen selection to clipboard. In this mode:

- Press [space] to capture a single window.

- Hold [⌥] to toggle whether to include window shadow.

[⇧⌘5] Show extra options, including screen record (10.14+)


[⌘MissionControl] Show desktop

[⌘Tab] Switch between apps. In this mode:

- Press Tab to go highlight the next app.

- Press [⇧Tab] or [`] to highlight the previous app.

- Press [Q] to quit the highlighted app.

- Press [H] to un/hide the highlighted app.

[⌘`] Switch between windows of the current app


[⌥Delete] Delete word

[⌥⇠]/[⌥⇢] Move cursor to next word

[⌥⇡]/[⌥⇣] Move cursor to next paragraph

[⌘⇠]/[⌘⇢] Move cursor to start/end of line

[⌘⇡]/[⌘⇣] Move cursor to start/end of text field

——— FINDER ———

[⌘Delete] Move to trash

[Enter] Rename selected file

[⌥⌘V] Move copied file here

- You can see this option if you open the Edit menu and hold down [⌥].

——— DRAGGING ———

- You can drag the "document proxy" icon in any titlebar. Make sure to hold the icon for a bit before dragging. (This delay is probably to prevent people who want to move the window from dragging the icon.)

- If you're dragging a file into a folder, press [Space] to immediately open the "spring-loaded" folder.

- In many apps, hold down [⌥] to duplicate instead of move.

- In Finder, dragging a file across filesystems will duplicate by default. Hold down [⌘] to move instead.

- You can [⌘Tab]/[⌘`] while you're dragging an item.

- To navigate a open/save dialog to a particular place, drag the folder or file into the edges of the dialog. Be careful not to drag it into the middle white area of the dialog, as in some cases it might move/copy the file.

- To open a Finder window at the same location as an open/save dialog, use [⌘R] (R for "reveal").


(Note: There are many more shortcuts in each category. These are just the ones that I find the most useful.)

Option (or Alt) ⌥ + Down Arrow in Finder. Goes into selected directory.

⌥↑ goes up in turn, which is super useful if you're in a file picker and the back button is disabled

You sure you don't mean Command?

Anyone have a good keyboard shortcut to switch between two screens?

The one I remember best is Control-OpenApple-Reset.

Which is all very well, but Macs have never had an OpenApple or Reset key (the Command key used to have an Apple symbol on it, but now just has the cloverleaf symbol).

Suggests your experience with Apple computers dates back at least to the '80s! :-D

That causes a reboot on an Apple IIGS!

Hammerspoon. Lets me define my own keybindings.

ctrl + command + 4 Saves screenshot in clipboard, saving your Desktop folder from screenshot clutter

Hit space after to select a window to capture.

cmd+delete = moves selected item to trash.

shift+cmd+delete = empties trash bin.

It's easily my goto combo to delete something fast.

⌘+shift+6 (touchbar screenshot)


Lock screen

Add in a shift and it logs you out too.

Command + Control + Q

Locks your screen


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact