Keyboard Tips in Sublime Text
I have a firm belief, which I’m sure I share with many other writers and coders, regarding text creation/editing. Since the primary goal is to create, edit and modify text, the more often you have to take your hands off the keyboard, the less efficient you are.
Since Sublime Text is my favorite code/text editor, I thought I’d share a few of the basic tips to avoid having to resort to the mouse. Most of these are popular from other text editors and operating systems, but I can’t vouch for all of them across all editors/systems past and present. This assumes you are familiar with basic navigation and text manipulation keyboard shortcuts.
Select Text With Keyboard (Characters)
This is serious 101 but I’ll start with it since it is the basis for later keyboard tips. Using the arrow keys, position your cursor at the beginning of the selection you want to make. Shift + Arrow key left or right until you reach the end of the section of text you want to select. Your selection should be highlighted.
Select Text (Words)
Using the arrow keys, position your cursor on or in a word. Click Control + D key (Command + D on OSX). The entire word will be highlighted and selected. You can also hold down the Shift + Control keys and use the arrow keys to increase your selected text to the end of the next word and continue to do so through multiple words, jumping to the end of each next word as you tap the arrow key.
Select Text (Line)
As above except using the Control + L (Command + L on OSX) to select the entire, current line.
Select Text (Paragraph)
If your text or code is organized into anything resembling paragraphs in Sublime Text (wrapped in tags, etc), you can use Control + Shift + A (Command + Shift + A on OSX) to select the CONTENTS of the paragraph (inside any tags). Click it again and the tags and content will be selected. In a next structure (HTML divs, Javascript parenthesis/bracketed/etc text), continuing to click Control + Shift + A will continue to expand the selection up/outward to the next, nested area. Great way to “step up” through nested content where the beginning/ends may become progressively less clear as the document get lengthy and complex.
Select Text (Indentation)
Position your cursor on an indented line Control + Shift + J (Command + Shift + J on OSX) and Sublime Text will select all lines with the same indentation level. Click it again to select the parent indentation level and so on. Great way to isolate nested blocks of text or code.