These are the keyboard shortcuts I actually use as a programmer on a Mac: moving between windows and Spaces in macOS, Terminal, Vim, VS Code, Chrome DevTools and Slack. Nothing exotic, just the ones that have stuck. They’re all default bindings, checked against each app’s own documentation, so if you’ve remapped keys yours may differ. On many Mac keyboards the top row does brightness and volume, so for anything with an F key you may need to hold fn as well.
Mac#
ctrl+←/→— move between Spaces (desktops)ctrl+↑— open Mission Controlcmd+tab— switch between appscmd+`— switch between windows of the app you’re inctrl+cmd+f— toggle full screen, in apps that support itcmd+w— close the front window (option+cmd+wcloses all of the app’s windows)
Vim#
vimtutor— Vim’s built-in tutorial, run it straight from your shellv— visual mode, selecting by characterV— visual mode, selecting whole linesctrl+v— visual block mode, selecting a rectangle of columnsy— yank (copy) the selection
Terminal#
sudo !!— re-run the last command with sudo (that’s the shell’s history expansion, so it works in zsh or bash in any terminal app)cmd+t— new tabcmd+n— new windowcmd+w— close the tab;shift+cmd+wcloses the windowctrl+tab/ctrl+shift+tab— next / previous tabcmd+d— split the window into two panesshift+cmd+d— close the split pane
VS Code#
cmd+p— Quick Open: jump to any file by typing part of its nameshift+cmd+p— the Command Palette (F1works too)cmd+d— add the next occurrence of the selection, so you can edit them all with multiple cursorsoption+ click — add a cursor where you click (option+cmd+↑/↓adds one above or below)option+↑/↓— move the current line up or downshift+option+↑/↓— copy the current line up or downcmd+/— toggle a line commentF12— go to definitionctrl+`— show or hide the integrated terminal
Chrome DevTools#
option+cmd+i— open DevTools on whichever panel you used lastoption+cmd+j— open DevTools on the Consoleshift+cmd+c— inspect element: click anything on the page to jump to it in the Elements panelshift+cmd+p— with DevTools open, the Command Menu (type “screenshot”, for example)shift+cmd+r— hard reload, fetching the page’s files again instead of using the cache
Slack#
cmd+k— jump to a conversation: type part of a channel or person’s name and press Enter (in recent versions the same box searches too)F6— move focus to the next section (shift+F6goes back)cmd+/— see all of Slack’s shortcuts
