Sublime Text Shortcuts for Writing

August 14, 2012 by Gabe | [mmd] |

Some more Sublime Text tips for general writing.1

Moving Around

Move to end of next word: Ctrl+Right Arrow

Move to beginning of previous word: Ctrl+Left Arrow

Jump to Cursor: Ctrl+l

Jump to matching bracket: Ctrl+m (Very handy for getting to the end of a Markdown link.)

Deleting

Delete Current Line: Ctrl+Shift+K

Delete to End of Line: Ctrl+K

Delete to Beginning of Line: ⌘+Delete

Delete to Beginning of Current Word: Option+Delete

Forward Delete: Fn+Delete

Forward Delete Word: Fn+Ctrl+Delete

Selection

Whatever editor is the flavor of the day, quick edits improve writing efficiency. ST2 has several built in commands for quickly selecting text. These can be found under the coincidentally named "Selection" menu:

Expand selection to Word: ⌘+D

Expand selection to Line: ⌘+L

⌘-D to select word. Repeat to add next occurrence to the selection.

Expand selection to scope is great for Markdown. Place the cursor inside of parentheses or brackets. Hit Shift+⌘+Space to select everything between.2

Or, place the cursor on a Markdown header and use Expand Selection to Scope:

To quickly select a Markdown code block, position the cursor immediately before the block and use Expand Selection to Indentation with ⌘+Shift+J

Case

Sublime Text is an odd-nut with some keyboard shortcuts because they often require two different combinations. One keyboard command enters a specific mode and the next combo triggers the command.

ST2 comes with several commands to quickly adjust the case of selected text. I use these regularly. While the commands are available under the edit menu, the keyboard shortcuts are much faster.

ST2 comes with just a couple shortcuts configured. I added the rest through my User Keybindings settings:

{ "keys": ["super+k", "super+s"], "command": "swap_case" },
{ "keys": ["super+k", "super+t"], "command": "title_case" }

SWAP case: ⌘+K and then ⌘+S

Title Case: ⌘+K and then ⌘+T

UPPER CASE: ⌘+K and then ⌘+U

lower case: ⌘+K and then ⌘+L

Bonus

Paste and Indent is awesome. Position the cursor below an indented line and hit

Shift+⌘+V

The clipboard is pasted at the same level of indentation.

I can't remember if I added it or it is there by default. Here's the setting:

{ "keys": ["super+shift+v"], "command": "paste_and_indent" }

Previous Sublime Text Tips:

ST for Writing

Working with Multiple Panes

Text Section Navigation

Sublime Text Bookmarks

A Couple of ST2 Tips


  1. BBEdit either already has these same shortcuts or can easily be coerced to perform the same function. 

  2. This is also available as Expand Selection to Bracket with Ctrl+Shift+m. 

blog comments powered by Disqus