Quickly Select One or More Lines in Sublime Text
In Sublime Text, you can select lines with a keystroke. Hit Cmd–L (Mac) or Ctrl–L (Windows) to select the current line. Repeat the keystroke to add the line below.
In Sublime Text, you can select lines with a keystroke. Hit Cmd–L (Mac) or Ctrl–L (Windows) to select the current line. Repeat the keystroke to add the line below.
Sublime Text allows you to quickly join lines together. Select the lines and hit Cmd–J (Mac) or Ctrl–J (Windows).
If nothing is selected, Sublime Text will join the line below to the current line.
Sublime Text allows you to quickly sort lines alphabetically. Select the lines you want to sort and choose Edit > Sort Lines. You can also use the keystroke F5 (Mac) or F9 (Windows).
While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy.
Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.
Windows Users: Ctrl–Alt and Arrow keys may rotate the screen. You may need to change or disable those keystrokes in your display settings.
Sublime text allows you to quickly convert selected text to upper case or lower case.
You can also convert to title case by choosing Edit > Convert Case > Title Case (there’s no keyboard shortcut).
Sublime Text with Emmet allows you to quickly adjust numbers in your code.
For example, you want to change 20px to 22px. Instead of selecting and typing the new number, click on the number and hit Ctrl–Up Arrow (Mac and Windows) to increase it 1px at a time. Increments of 0.1 and 10 also work:
Increase/Decrease by 0.1: Hold Option (Mac) or Alt (Windows) and hit Up or Down Arrow
Increase/Decrease by 1: Hold Ctrl (Mac or Windows) and hit Up or Down Arrow
Increase/Decrease by 10: Hold Cmd–Option (Mac) or Shift–Alt (Windows) and hit Up or Down Arrow
Some text editors only allow one text cursor, but Sublime Text allows multiple. This is really useful, for example, if you want to insert the same word in multiple places.
Click anywhere in the code to place the text cursor. Cmd–Click (Mac) or Ctrl–Click(Windows) to place an additional text cursor. You can place as many cursors as you want!
With Sublime Text you can quickly select everything inside an HTML tag. Just click anywhere inside the tag and hit Cmd–Shift–A (Mac) or Ctrl–Shift–A (Windows).
Hit Option–Delete (Mac) or Ctrl–Backspace (Windows) to delete the word to the left of the cursor. This is an operating system feature so it should work in any text editor.
This same technique can be also be used in the opposite direction. Hit Option–Fn–Delete (Mac) or Ctrl–Delete (Windows) to delete the word to the right of the text cursor.
In CSS, type tac and hit Tab to expand to text-align: center;