2
votes

Is there any shortcut to select entire code block in Atom similar to Option + Up Arrow in PhpStorm?

It helps you select the code block and if you press Option + Up Arrow again, it expands the selection to its parent block.

Is there any shortcut or plugin to have that feature? It makes it faster to work with heavy code.

3

3 Answers

3
votes

Yes! You want the expand-region plugin, it's great! Add these to your keymap.cson to expand the region with option-up (alt-up on windows) :

'atom-text-editor':
  'alt-up': 'expand-region:expand'
  'alt-down': 'expand-region:shrink'
2
votes

Ctrl+Alt+M (Cmd+Ctrl+M on Mac) selects entire code inside the current brackets. It doesn't expand to the parent block though.
If you need that feature, you might want to look for some package. There is select-scope package that claims to add that functionality. I haven't tested if it works. It also doesn't seem to show up on the package list in every atom version.
If you decide to try that package out, you may need to override it's key-binding as it uses Ctrl+S.

1
votes

This is now built into Atom.

https://blog.atom.io/2018/10/23/atom-1-32.html

Select Larger/Smaller Syntax Node