Say you want to spot every line in a config or log file that contains a #, a !, or any other character. Sublime Text doesn’t ship a dedicated “highlight lines with this character” command, but you get it for free by combining regex search with Find All: since the match itself is the whole line, selecting the match highlights the whole line.
The Core Move
- Open the Find panel.
- Turn on regular expressions.
- Search for
^.*X.*$, swappingXfor your character (escape it with a backslash if it’s a regex-special character like.,*,$, or?). - Click Find All (or use its shortcut) instead of pressing Enter.
Because the regex matches the entire line, not just the character, Find All turns every matching line into a selection, which Sublime highlights edge to edge. Same result you’d get from Cmd/Ctrl-clicking each line by hand, just instant.
Shortcuts by Platform
| Action | Windows / Linux | macOS |
|---|---|---|
| Open Find panel | Ctrl+F | Cmd+F |
| Toggle regex | Alt+R | Cmd+Option+R |
| Find All | Alt+Enter | Option+Enter |
If you’d rather not memorize the regex toggle, just click the .* icon on the right side of the Find bar. It’s identical on both platforms.
Example
To highlight every line containing a #:
^.*#.*$
To highlight every line containing a literal period:
^.*\..*$
Bonus: Make It Stick
A Find All selection disappears the moment you click elsewhere. If you want a marker that survives normal editing, bookmark the selection instead of just leaving it selected:
- Do the Find All from above.
- Press
Ctrl+F2(Windows/Linux) orCmd+F2(macOS).
Every selected line gets a bookmark dot in the gutter, and you can hop between them afterward with F2 / Shift+F2, no regex re-typing needed.
That’s it. Not a plugin, not a setting, just Find All doing double duty as a line highlighter.