Search code examples
phpstorm

Select text wrapped in quotation marks


Is it possible to select text wrapped in quotation marks or other signs in PhpStorm (2016)?

I.e.

"Here is some code"

When I use shortcut I want to select all what is in quotation marks.


Solution

  • This depends on the context: what the actual language is. It works fine for PHP & JavaScript but does not seem to do anything special in HTML (as " are treated as part of the actual text).

    1. Place caret inside of such a string.

    2. Use Edit | Extend Selection (Ctrl + W on Windows/Linux using Default keymap; on Mac it most likely will be Alt + Arrow Up or similar)

    3. You will need to use that shortcut a few times in a row (at least 2 times if there are more than one word in a string) until it selects the whole string content. That's because this shortcut works in incremental mode: first the current word, then the whole sentence or other outer code construction and so on (each language can provide own boundaries of the "block").