Stop dragging your mouse through GitHub comments: 12 Mac text-box tricks for developers (2026)

2026-11-28来源 dev.toEnglish
Stop dragging your mouse through GitHub comments: 12 Mac text-box tricks for developers (2026)

A lot of developer writing never touches an editor. It happens in a small text box on GitHub, Jira, or a review tool, where you drag the trackpad across three lines, overshoot by a word, and start the selection again.

macOS ships with more keyboard control over those boxes than most of us use. These are the ones I lean on for PR comments, ticket descriptions, and review threads. Apple notes that text shortcuts can behave differently from app to app, so try each one in the browser and site you actually use.

Select without the trackpad

1. Grab a whole paragraph: Shift + Option + Up or Down Arrow

This extends the selection to the start or end of the current paragraph, and pressing it again keeps going to the next one. It's the fastest way to lift a "Steps to reproduce" block out of a ticket and move it somewhere else. (Apple: Mac keyboard shortcuts)

2. Select to the edge: Shift + Command + Arrows

Shift + Command + Left or Right selects to the start or end of the line. Shift + Command + Up or Down selects everything back to the top or down to the bottom of the text, which beats Command + A when you only want to replace the second half of a long comment.

3. Jump to the top or bottom: Command + Up or Down Arrow

Same idea without the selection. Handy when you've pasted a stack trace into a review comment and need to get back to the sentence you were writing above it.

Borrow a few Emacs keys

4. Line start and end: Control + A and Control + E

These move the cursor to the beginning or end of the line or paragraph, and your hands stay on the home row. Apple lists them in its own text-editing shortcuts, so they aren't a hidden terminal-only thing.

5. Open a line below without moving: Control + O

Control + O inserts a new line after the insertion point while the cursor stays where it is. Useful when you realize mid-sentence that a sub-bullet belongs underneath and you want to finish the current thought first.

6. Forward delete on a laptop: Control + D or Fn + Delete

MacBook keyboards don't have a dedicated Forward Delete key. Control + D (or Fn + Delete) removes the character to the right of the cursor, which is what you want when you've clicked just before a stray character instead of after it.

Markdown boxes on GitHub

7. Turn selected text into a link: Command + K, or just paste

In GitHub comments, Command + K inserts Markdown link syntax, and pasting a URL over highlighted text creates a Markdown link directly. Command + E wraps the selection as inline code, which saves hunting for the backtick key on every function name. (GitHub Docs: keyboard shortcuts)

8. Preview and submit from the keyboard: Command + Shift + P, then Command + Return

Command + Shift + P toggles between the Write and Preview tabs, so you can check that your table or nested list renders before anyone else sees it. Command + Return submits the comment once it looks right.

Let macOS check your work

9. Jump to the next typo: Command + Semicolon (;)

This moves to the next misspelled word in the document so you can fix them one after another instead of scanning for red underlines. Shift + Command + Colon (:) opens the full Spelling and Grammar window when you want suggestions.

10. Give any menu command a shortcut

In System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts, you can assign a key combination to an existing menu command in one app or in all apps. Type the menu path exactly as it appears, using -> between levels, for example Edit->Spelling and Grammar->Check Spelling While Typing, so you can switch spell check on and off without digging through menus. (Apple: Create keyboard shortcuts for apps)

11. Autocomplete and rewrites with DraftKey

DraftKey is a menu bar app that adds Tab autocomplete while you type, plus rewrites you review before anything gets inserted. It fits the same keyboard-first habit as the shortcuts above, and its settings let you choose which apps it works in. It's $4.99 once for up to 3 Macs, with 500 free words per Mac to try it. It needs Apple Silicon, macOS 14 or later, and 8 GB of RAM, and the download is about 1.12 GB. (getdraftkey.com)

DraftKey settings window on macOS

12. Copy text out of a screenshot: Live Text

When a teammate sends a screenshot of an error instead of the text, open it in Preview, drag across the words, Control-click, and choose Copy Text. Safari supports the same thing for images on web pages, so you can paste the exact error message into the issue instead of retyping it. (Apple: Live Text in Preview)

Quick picker

You want to... Press
Select a paragraph Shift + Option + Up/Down
Select to line or text edge Shift + Command + Arrows
Jump to top or bottom Command + Up/Down
Go to line start or end Control + A / Control + E
Add a line below, stay put Control + O
Forward delete Control + D or Fn + Delete
Markdown link on GitHub Command + K, or paste a URL over text
Preview, then submit on GitHub Command + Shift + P, Command + Return
Next misspelled word Command + ;
Shortcut for any menu item System Settings > Keyboard > App Shortcuts
Text from a screenshot Preview > drag, Control-click, Copy Text

Which text-box shortcut do you use every day that isn't on this list?

原文:https://www.a8q9.cn/en/article/stop-dragging-your-mouse-through-github-comments-12-mac-text-box-tricks-for-deve-a99be2.html

相关文章