By Manny Fernandez

September 21, 2026

Sublime Text Quick Tip: Highlight Every Line Containing a Specific Character

Sublime Text Quick Tip: Highlight Every Line Containing a Specific Character

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

  1. Open the Find panel.
  2. Turn on regular expressions.
  3. Search for ^.*X.*$, swapping X for your character (escape it with a backslash if it’s a regex-special character like ., *, $, or ?).
  4. 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:

  1. Do the Find All from above.
  2. Press Ctrl+F2 (Windows/Linux) or Cmd+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.

tmux Tips and Tricks: Sessions, Panes, Use Cases and Rare Tidbits

tmux Tips and Tricks: Sessions, Panes, Use Cases and Rare Tidbits

Learn tmux tips and tricks: named sessions, a starter tmux.conf, logging, synchronize-panes, real use cases and rare tidbits.

Read More
iTerm2 AI Watches: Stop Babysitting Your Terminal and Get Alerts on Your iPhone

iTerm2 AI Watches: Stop Babysitting Your Terminal and Get Alerts on Your iPhone

Set up iTerm2 AI Watches so a linked AI chat tells you when a long job finishes or fails, then push the alert to...

Read More
Claude Code Spinner Verbs: What Combobulating Really Means

Claude Code Spinner Verbs: What Combobulating Really Means

Claude Code spinner verbs explained: what Combobulating really means, a translated field guide, and how to add your own with the spinnerVerbs setting.

Read More