Select and copy code between brackets

In my phpStorm 7.1.3 setting cursor on open bracket I see end bracket  selected and and line at left showing code between these brackets.
Can I in this location :
1) Move to the end bracket ?
2) Copy all code  between these brackets to clipboard ?

Thanks !

7 comments
Comment actions Permalink

Hi,

Yes, you can do it. Please check corresponding shortcut in "Settings->Keymap". Search for "Move Caret".

0
Comment actions Permalink

Hi there,

Please always provide some example code as it's not always possible to clearly describe all aspects using words only.


1) What exactly do you mean by "brackets"? Different people mean different things: {}, () etc

If it's about {} -- then it's Ctrl+Shift+] (Settings | Keymap | Editor Actions | Move Caret to Code Block End with Selection)

If it's about () -- then there is no such action available -- http://youtrack.jetbrains.com/issue/IDEA-12068

But you can always try Ctrl+W (Select Word at caret)  .. or how it's called now in v8 "Edit | Extend Selection" -- may work good enough for your needs (depends on actual text/code).


2) Once you have made selection you can copy it, right? So ... did Ctrl+C (Edit | Copy) stopped working for you?

1
Comment actions Permalink

I wanted something for selecting everything between () too and did not find anything.

To solve this I wrote a small plugin.
See it in action here: https://plugins.jetbrains.com/plugin/11322-bracket-selection and feel free to give it a try

1
Comment actions Permalink

@Jeno De Keyzar your extension is awesome, but it be more awesome if you can make it for Android Studio, thanks.

0
Comment actions Permalink

@Hiwadoski21 It is available for Android Studio, see the Versions section:

If it's still not working for Android Studio, please let me know.

1
Comment actions Permalink

It looks very good. Would it be hard to make it compatible with WebStorm 2019.2?

0
Comment actions Permalink

Asanokhin, it is, please try.

0

Please sign in to leave a comment.