Mac Text Editing Shortcuts

Yinchi Luo
2 min readDec 9, 2020

Motivation

A note for myself and for anyone who want to edit text more efficient.

Notation

Command ⌘ | Shift ⇧ | Option ⌥ | Control ⌃

Basic

  • Command-X: Cut the selected item and copy it to the Clipboard.
  • Command-C: Copy the selected item to the Clipboard.
  • Command-V: Paste the contents of the Clipboard into the current document or app.
  • Command-Z: Undo the previous command. You can then press
  • Shift-Command-Z: Redo, reversing the undo command.
  • Command-A: Select all lines.

I also want to point out CLI command pbcopy will copy the stdin to the Clipboard, whereas pbpaste will paste from the Clipboard, illustrated in the following:

$ seq 1 3 | pbcopy
$ pbpaste
1
2
3

Move Cursor

  • Control-F: Move one character forward.
  • Control-B: Move one character backward.
  • Control-P: Move up one line.
  • Control-N: Move down one line.
  • Control-A: Move to the beginning of the line or paragraph (depends on where the line breaker is).
  • Control-E: Move to the end of a line or paragraph (depends on where the line breaker is).
  • Command–Left Arrow: Move to the beginning of the current line.
  • Command–Right Arrow: Move to the end of the current line.
  • Command–Up Arrow: Move to the beginning of the document.
  • Command–Down Arrow: Move to the end of the document.
  • Option–Left Arrow: Move to the beginning of the previous word (beginning of the current word if the cursor is in the middle of a word).
  • Option–Right Arrow: Move to the end of the next word (end of the current word if the cursor is in the middle of a word).

Select

  • Shift–<Move Cursor Shortcut>: Select from insertion point to move point. (e.g., Shift–Control–E will select from cursor to the end of a line or paragraph, since Control–E move the cursor to the end of line or paragraph; Shift–Option–Left Arrow will select from cursor to the end of next word, since Option–Left Arrow move cursor to the end of the next word)

After Selection, you can use whatever shortcut in Delete section below to delete the selected text.

Delete

  • Control-H: Delete the character to the left of the insertion point.
  • Control-D: Delete the character to the right of the insertion point.
  • Control-K: Delete the text between the insertion point and the end of the line or paragraph.

Reference

Mac keyboard shortcuts, I basically just select the relevant shortcuts from there, simplify some explanations and add some clarifications.

--

--

Yinchi Luo

Cloud native & remote native, Senior Software Engineer @ Instana