skip to Main Content

example of what I’m talking about

I’d like to be able to edit the words that are “soft-highlighted” in the second image all at once.

I’m aware that you can manually multiline select the words, but there has got to be a way to use this feature, preferably a shortcut.

2

Answers


  1. You can use find and replace (Use the Replace command in the command palette (default bound to ctrl/cmd+h)): put the text to replace in the find input, and the replacement text in the replace input, and then click the button that says to Replace All (or use the keyboard shortcut in its tooltip).

    There’s also the Add Selection To Next Find Match command, which when used with no selected text, selects the word under the caret, and when text is selected, adds the next instance of the selected text to the selection. If the instances you want to replace are consecutive, just use that until all the instances you want to replace are selected, and then type the text you want to replace them with.

    And yes, as you mentioned, you can create multiple cursors (Ex. with alt+click).

    Note: the highlighting behaviour you’re talking about is controlled by the editor.occurrencesHighlight setting. There’s also a similar feature controlled by the editor.selectionHighlight setting.

    Login or Signup to reply.
  2. You can select all those matches (they are called "find matches" because they derive from the same functionality as if you had a find value in the Find Widget) at once with the command

    Select All Occurrences of Find Match
    

    which is bound to Ctrl+Shift+L by default. All matches to the word under the cursor will be selected.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search