Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hotkey to jump past closing brackets in JetBrains PhpStorm

Right now I'm just using PhpStorm to work with some HTML, and it's great in that it auto indents and automatically closes out HTML tags.

The only problem is this feature doesn't really save me any time because I then have to use my mouse or arrow keys to navigate past the closing tag when I reach it. For example I type <p> and it closes it out <p></p> with my cursor in between, but when I'm done I either have to manually navigate past the closing bracket or use Shift+Enter to jump down to the next line (which isn't always what I want to do).

Is there a command that will just jump me to the end of the next closing bracket, or is there a way of setting this up? I've googled it but haven't been able to find anything.

like image 661
user1325093 Avatar asked Apr 02 '15 23:04

user1325093


2 Answers

I've googled it but haven't been able to find anything.

Well... Help | Default Keymap Reference has the most needed shortcuts and actions listed and the one you need is there.


In any case:

Ctrl + ] -- Navigate to code block end -- will jump to the closest closing tag (in HTML) or brace/closing keyword (CSS, PHP).

Ctrl + [ will do the opposite -- jump to the opening tag.

There are few other actions that can help here but may not have any shortcuts assigned by default -- check them in Settings (Preferences on Mac) | Appearance & Behaviour | Keymap (it has search by action name and even by already assigned shortcuts).


Another alternative (or better say -- advanced navigation) would be using AceJump pluign (you have to see it in action -- you either like or hate it).. or even Vim mode navigation (via IdeaVim plugin).

like image 150
LazyOne Avatar answered Sep 23 '22 11:09

LazyOne


The simplest way to go about this is to press Command + -> (command+right arrow key) when your cursor is inside the brackets, and this will bring you behind the last bracket.

At least, I believe this is what you're asking.

like image 36
Mason Avatar answered Sep 22 '22 11:09

Mason