How to not use a Mouse on OSX

This is a list of OSX hotkeys for common apps. They can be used in place of many mouse/trackpad operations to speed up workflows.

Here’s an example of the kind of thing you can do…

Example

Here’s how I would send someone a link to a line in my dotfiles on slack.

  • Is Chrome open?
    • No
      • ⌘ + space to open spotlight
      • Start typing chrome until spotlight finds Chrome (this usually only requires me to type c) then hit Enter to open Chrome
    • Yes
      • ⌘ + Tab to open a list of running applications
      • hold then hit Tab until you get to Chrome
  • Does Chrome have an open window?
    • No - ⌘ + n to open a new window
    • Yes - skip this step
  • Are you in a new tab?
    • No - ⌘ + t to open a new one
    • Yes - skip this step
  • ⌘ + l to highlight whatever is in the address bar
  • type git dav dot in the search bar; Chrome will look through my history for a URL that matches each of these strings. When I see the URL I want in the suggestions, I hit Tab to get to it and then Enter to go to it. I’m now in the github repo.
  • t to enter search mode in the github repo
  • start typing alias into the search until .aliases is the first choice (usually only takes al) then press Enter
  • y to switch the URL to reference the SHA of file’s current commit
  • l26 to highlight the line I want to send, line 26
  • ⌘ + l to highlight the current URL
  • ⌘ + c to copy the URL
  • Is Slack open?
    • No
      • ⌘ + space to open spotlight
      • Start typing slack until spotlight finds Slack (this usually only requires me to type sl) then hit Enter to open Slack
    • Yes
      • ⌘ + Tab to open a list of running applications
      • hold then hit Tab until you get to Slack
  • ⌘ + k then type in the first few letters of the person I want to send the message to, then hit Enter
  • ⌘ + v to paste the URL, then Enter to send

Boom. No mouse clicks!

General OSX

  • ⌘ + c = copy
  • ⌘ + v = paste
  • ⌘ + V = paste without formatting
  • ⌘ + x = cut
  • ⌘ + b = bold selected text
  • ⌘ + i = italicize selected text
  • ⌘ + u = underline selected text
  • ⌘ + z = undo
  • ⌘ + y = redo
  • ⌘ + m = minimize current window
  • ⌘ + n = open new window
  • ⌘ + ` = toggle open windows of current program
  • ⌘ + f = find text
  • ⌘ + a = select all
  • ⌘ + p = print
  • ⌘ + s = save
  • ⌘ + q = quit application
  • ⌘ + w = close current application window
  • ⌘ + Tab = switch to last application
  • ⌘(hold) + Tab = view open applications, while still holding :
    • Tab = select next running application
    • ←/→ = select previous/next running application
    • q = quit selected application
    • n = open a new window for the selected application
    • (release key) = switch to selected application
  • ⌘ + space = open searchlight

When in a text-editing context:

  • OPT + delete = delete previous word
  • ⌘ + delete = delete to beginning of line
  • ⌘ + Shift + ←/→ - select to beginning/end of line
  • ⌘ + Shift + ↑/↓ - select to top/bottom of document
  • OPT + Shift + ←/→ - select previous/next word
  • ⌘ + ← = move cursor to start of line
  • ⌘ + → = move cursor to end of line
  • ⌘ + ↑ = move cursor to top of document
  • ⌘ + ↓ = move cursor to bottom of document
  • OPT + ← = move cursor to start of current word
  • OPT + → = move cursor to end of current word
  • FN + delete = forward delete
  • SHIFT + ↑/↓ = select up/down one line

Chrome

  • ⌘ + f = find text
  • ⌘ + t = open a new tab
  • ⌘ + l = highlight URL of current page
  • ⌘ + OPT + ←/→ = move to previous/next tab
  • ⌘ + w = close tab
  • ⌘ + r = refresh tab
  • ⌘ + R = hard refresh tab
  • ⌘ + -/+ = zoom out/in
  • ⌘(hold) + l + ENTER = duplicate current tab
  • ⌘ + ←/→ = go to previous/next in history
  • ⌘ + 9 = jump to last tab
  • ⌘ + (1-8) = jump to n-th tab
  • ⌘ + C = view DOM, dev tools
  • type search string into address bar to run google search
    • use Tab to move to next auto-completed suggestion
    • use Tab to move cursor to next search option, enter to select

Requires 3rd-party applications:

  • ⌘ + \ = open 1password

Gmail

  • gi = navigate to inbox
  • gt = navigate to sent folder
  • / = to search
  • j = move cursor down (to previous email)
  • k = move cursor up (to next email)
  • s = star/unstar the current email
  • x = select current email
  • * + u = select all unread emails
  • * + a = select all emails in current scope
  • c = enter compose mode (must be in inbox)

Once you are in compose mode:

  • Tab = move between to/from, subject, and body fields
  • ⌘ + ENTER = send email

Once one or more emails have been selected you can:

  • I = mark as read
  • U = mark as unread
  • = = mark as important
  • - = mark as unimportant
  • e = archive it
  • * + n = deselect all
  • ENTER = view selected email

Once you are in view mode for a given email you can:

  • r = reply to email
  • a = reply all to email
  • f = forward email
  • u = go back to thread-view

iTerm

I highly recommend mapping your Caps Lock key to CNTL

The following hotkeys work even with Tmux

  • CNTL + a = jump to start of line
  • CNTL + e = jump to end of line
  • CNTL + u = delete to beginning of line
  • CNTL + c = delete entire line
  • CNTL + r = search for previous commands containing search string
  • CNTL + p = repeat last command
  • CNTL + b = go back a character
  • CNTL + d = delete forward
  • CNTL + w = delete back to previous space
  • CNTL + f = go forward a character

Won’t work in Tmux session

  • ⌘ + d = split screen vertically
  • ⌘ + SHIFT + d = split screen horizontally
  • ⌘ + w = close terminal window
  • ⌘ + OPT + arrow key = move between terminal windows
  • CTRL + k = delete to end of line (I mapped this to move to lower tmux pane)

Github

  • t = search repository by file name
    • ESC = exits search mode
  • w = search repository by branch name
  • ? = open list of hotkeys
  • gi = jump to issues
    • c = create issue (when on issues page)
  • gc = jump to code
  • gp = jump to pull requests

When viewing a code file:

  • y = change URL to reference the specific commit SHA of the code you’re looking at
  • l = go to line

Slack

  • ⌘ + k = search for and jump to conversation

Vim

Vim is a text editor that allows you to completely avoid using a mouse. I use these commands most often in Vim.

Tmux

Tmux allows you to manage windows and panes in your terminal without using a mouse (among other things). Here’s a list of the commands I most often use in Tmux.

Sublime

  • ⌘ + n = open a new tab
  • ⌘ + OPT + arrow key = move to tab
  • ⌘ + w = close tab
  • SHIFT + ↑/↓ = highlight line above/below
  • ⌘ + ←/→/↑/↓ = jump to start/end of line or top/bottom of the doc
  • ⌘ + SHIFT + ←/→ = highlight to beginning/end of line
  • ⌘ + SHIFT + L = open cursor on each highlighted line
  • ⌘ + CTRL + G = open cursor at each instance of highlighted text
  • ⌘ + D = open cursor at next instance of highlighted text
  • ⌘ + P = find file by name
  • ⌘ + SHIFT + F = grep for string through entire directory
  • ⌘ + R = jump to symbol on current page