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

后端 未结 10 1308
一向
一向 2020-12-02 03:34

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:

10条回答
  •  天涯浪人
    2020-12-02 04:07

    To me, this is the biggest mistake in Sublime. Alt+F3 is hard to reach/remember, and Ctrl+Shift+G makes no sense considering Ctrl+D is "add next instance to selection".

    Add this to your User Key Bindings (Preferences > Key Bindings):

    { "keys": ["ctrl+shift+d"], "command": "find_all_under" },
    

    Now you can highlight something, press Ctrl+Shift+D, and it will add every other instance in the file to the selection.

提交回复
热议问题