Search code examples
webstorm

WebStorm skip find occurrence hotkey


I've recently moved from Sublime Text 3 to WebStorm 11 and I am missing a key feature when selecting occurrences of the same selection:
The ability to skip a selection (with a hotkey).

Use case

const item = { itemValue: 1, itemName: 'one' };
console.log(item.itemValue);

Selecting the first item and pressing Ctrl + G (Mac) will start selecting the item occurrences inside the object properties, and I want to select only the item right after the const and inside the console.log. Essentially, I want to skip the two item occurrences inside the object.

This is a dummy use case to illustrate the point, I know I can Refactor > Rename it.


Solution

  • Highlight the text you want to edit:

    first selection

    Ctrl+G will find the next occurrence of the highlighted text and select it:

    second selection

    Cmd+G will drop the current selection and select the next one:

    third selection

    Cmd+G one more time will drop the current selection and select the next one:

    final selection

    For anyone that has a different Keymap:

    Cmd+G: "Find Next / Move to Next Occurrence"

    Ctrl+G: "Add Selection for Next Occurrence"