
Ask HN: The most useful Mac keyboard shortcuts? - yesenadam
Ones that most people don&#x27;t know about, that you actually regularly use. Thank you!<p>Edit: &quot;Not a shortcut exactly...&quot; tips are most welcome too.
======
jonhess
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.

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

~~~
AlchemistCamp
> cmd+e seems to be a safari thing

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

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

------
zuccs
Spectacle ([https://github.com/eczarny/spectacle#keyboard-
shortcuts](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](https://github.com/tekezo/Karabiner-Elements)) to remap keys to
something more useful (who uses Caps Lock anymore?)

~~~
ebg13
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](https://github.com/rxhanson/Rectangle)

~~~
RobertKerans
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

[https://github.com/ianyh/Amethyst](https://github.com/ianyh/Amethyst)

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

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

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

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

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

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

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

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

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

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

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

~~~
usaphp
You mean on a trackpad?

~~~
gumby
Yes, sorry, that’s what I meant.

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

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

------
jboldenz
Shift-option-command-v: paste text _without any formatting_ as opposed to
simply using command-v

~~~
i386
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](https://github.com/i386/plainjane)

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

~~~
luckman212
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/](https://manytricks.com/witch/)

~~~
tenantless
Was wondering the same thing, the developer indicated it does via Twitter:
[https://twitter.com/contextsapp/status/1138209813714821120](https://twitter.com/contextsapp/status/1138209813714821120)

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

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

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

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

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

------
xeno42
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)

------
jonbaer
Shift+Cmd+4 for screenshot(s)

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

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

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

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

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

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

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

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

[https://github.com/Clipy/Clipy](https://github.com/Clipy/Clipy)

~~~
aantix
Does Clipy support images?

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

~~~
scarecrowbob
Yes.

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

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

------
rayascott
Mac Keyboard Shortcuts for a comprehensive list:
[https://support.apple.com/en-gb/HT201236](https://support.apple.com/en-
gb/HT201236)

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

"Go to the folder:"

~~~
kohtatsu
FWIW tab completion works in that dialog.

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

[https://github.com/nikitavoloboev/dotfiles](https://github.com/nikitavoloboev/dotfiles)

------
jsonau
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!

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

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

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

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

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

------
cygned
⌘^q to lock the screen

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

~~~
cygned
^ is the symbol for ctrl, sorry for the inconvenience

~~~
sethammons
doh, my bad!

------
vinhnx
macOS:

* 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 "≠", "≥", "≤", "–"

Apps:

\+ 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](https://github.com/eczarny/spectacle#keyboard-shortcuts). And also,
as zuccs's comment
[https://news.ycombinator.com/item?id=20621517](https://news.ycombinator.com/item?id=20621517)

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

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

------
elamje
If you have a touchbar - [https://pock.dev](https://pock.dev) is a huge
improvement.

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

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

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

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

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

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

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

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

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

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

~~~
w4tson
Me too! It’s a great tip

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

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

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

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

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

------
aantix
Vimium browser extension.

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

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

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

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

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

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

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

~~~
danaris
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

------
dochench
Hammerspoon. Lets me define my own keybindings.

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

~~~
canthonytucci
Hit space after to select a window to capture.

------
avelis
cmd+delete = moves selected item to trash.

shift+cmd+delete = empties trash bin.

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

------
binarynate
⌘+shift+6 (touchbar screenshot)

------
deca6cda37d0
CMD + CTRL + Q

Lock screen

~~~
drcongo
Add in a shift and it logs you out too.

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

——— SCREENSHOTS ———

[⌃⇧⌘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+)

——— MISSION CONTROL ———

[⌘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

——— TEXT EDITING ———

[⌥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.)

------
BGthaOG
Command + Control + Q

Locks your screen

