How to select all instances of a variable and edit variable name in Sublime

问题:

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:我尝试过的事情:

⌘ D , ⌘ K , and ⌘ U lets me select them one-by-one, but I have to manually exclude the non-variable string matches: ⌘ D 、 ⌘ K和⌘ U让我可以一一选择它们,但我必须手动排除非可变字符串匹配项:

在此处输入图片说明

And using Ctrl ⌘ G simply selects all the string matches:使用Ctrl ⌘ G只需选择所有匹配的字符串:

在此处输入图片说明

Clearly, Sublime is able to differentiate between variable and string matches.显然,Sublime 能够区分变量匹配和字符串匹配。 Is there no way to select just the variable matches?有没有办法只选择变量匹配?


解决方案:

参考一: https://en.stackoom.com/question/18g41
参考二: https://stackoom.com/question/18g41
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章