QoL: Smart select around single quotes in iTerm
tl;dw: double click around single quotes to select
QoL: Quality of Life improvements.
Sharpening the axe is useful (and rewarding) and 1% improvements compound.
I have used the iTerm terminal emulator for years, for as long as I remember using macOS. Its βSmart Selectionβ feature enables double-clicking1 on text to semantically select it (e.g., URLs, email addresses, text wrapped by double quotes, etc.).
Smart Selection is super nice, but by default does not work for text within single quotes. To fix that:
- Open your iTerm settings
- β Profiles (tab)
- β Advanced (tab)
- β Smart Selection
- β Click on β+β
- Use βSingle quoted stringβ or any description youβd like, then
@?'(?:[^'\\]|\\.)*'
as the regular expression.
# Footnotes
-
By default is configured to smart-select on quadruple-click, but you can change that to double click in General/Selection.Β ↩