Sublime Text: Select all instances of a variable a

2019-01-12 13:48发布

问题:

I'm new to Sublime, and I just discovered that if I select a variable (not just any string) in my code, all other instances of that variable get a stroke (white outline) around them:

Is there a keyboard shortcut that will let me select all of those instances of the variable and edit them all at once?


Things I've tried:

Using D, K, and U lets me select them one-by-one, but I have to manually exclude the non-variable string matches:

And using CtrlG simply selects all the string matches:

Clearly, Sublime is able to differentiate between variable- and string-matches. Is there no way to select just the variable matches?

回答1:

1. PUT THE CURSOR IN THE VARIABLE   ⚠️ don't select anything – just put your cursor there.

2. PRESS D as needed. Not on a Mac? CtrlD