Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you batch select text between quotes in IntelliJ IDEA?

Given the following Java code

enter image description here

On the MacBook in IntelliJ IDEA, I can hold the option key and mouse click 'n drag to select a block of text.

enter image description here

Is it possible to batch select just the text between the quotes all at once within a specific block of code, similar to Option+MouseClickAndDrag feature above, like this?

enter image description here


Notes added based on comments below

Cmd+W doesn't work since it expands the selection to highlight the full line, and eventually the entire code block. It does not select just the strings.

Shift+Alt+double-click is a closer solution, but requires you to manually double-click each string. I'd like a solution that selects them all at once.

like image 982
TERACytE Avatar asked Aug 27 '15 17:08

TERACytE


People also ask

How do you select text between quotes?

Simply put your cursor between two quotes and hit Ctrl ' to select the text between the quotes. Hit it again and it will select the quote marks themselves.

How do I select all the same words in IntelliJ?

You can use ⌃⌘G (macOS), or Ctrl+Alt+Shift+J to select all matching words in the document rather than selecting one at a time. You can use ⌃⇧G (macOS), or Alt+Shift+J (Windows/Linux) to remove the selection from the last selected occurrence.

How do I select text in IntelliJ?

Simply hit ctrl+c.

How do I navigate between methods in IntelliJ?

To navigate backwards, press Ctrl+Alt+Left . To navigate forward, press Ctrl+Alt+Right . To navigate to the last edited location, press Ctrl+Shift+Backspace . To find the current caret location in the editor, press Ctrl+M .


1 Answers

If you use CMD/CTRL + W multiple times, you can expand your selection from the current cursor word to the enclosed string, to current line, depending on how many times your press it. This is depending on where your cursor is, at the time, unfortunately.

This tripped me up when I first started, because I always thought I was closing a tab

like image 111
IanGabes Avatar answered Oct 08 '22 05:10

IanGabes