skip to Main Content

In VS Code, pressing Shift+Command+L creates a cursor for every occurrences strings and you can modify them all at once. Is there a similar shortcut for the JetBrains IDEs such as Intellij IDEA?

2

Answers


  1. Edit | Find | Select All Occurrences action does it:

    Select All Occurrences

    Login or Signup to reply.
  2. Yes there is. You can read more about ways to create multiple cursors and selection ranes on their dedicated help page: https://www.jetbrains.com/help/idea/multicursor.html (I’ll use links for the Intellij IDEA help pages, but you the instructions should be similar for all the IDEs in the JetBrains family. To get the help pages for a specific one, visit their general help page, then select an IDE, and then use the search function to search "multicursor").

    In particular, see this section named "Select multiple occurrences of a word or a text range" Here’s an excerpt when the Shortcuts mode is set to "Windows" (visit that link and switch the shortcut mode to whichever platform you are on)

    If you want to select words, set your caret at an occurrence of the desired word. Otherwise, select the desired range with the mouse or with keyboard shortcuts.

    1. If you want to select words, set your caret at an occurrence of the desired word. Otherwise, select the desired range with the mouse or with keyboard shortcuts.

    2. Do one of the following:

      • Successively press Alt+J to find and select the next occurrence of case-sensitively matching word or text range.

      • Press Ctrl+Alt+Shift+J to select all case-sensitively matching words or text ranges in the document.

    3. To remove selection from the last selected occurrence, press Alt+Shift+J.

    4. After the second or any consecutive selection was added with Alt+J, you can skip it and select the next occurrence with F3. To return the selection to the lastly skipped occurrence, press Shift+F3.

    Other functions include:

    You can do it with the mouse while holding Alt+Shift+Click the target location to add another caret. You can Alt+Shift+Click one of the existing carets to remove it.

    To add carets above or below the current caret using the keyboard, Press Ctrl twice, and then without releasing it, press the up or down arrow key. Or you can enable the column selection mode (press Alt+Shift+Insert) and then press Shift+Up/Shift+Down.

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