Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA find matching markup tag

Tags:

Is there a shortcut or where I can click to find the matching tag of a markup tag and bring the focus/cursor there?

For example, <p><span></span><div></div></p>

If my cursor is on the closing </p> tag, I would like to IDEA to bring me to the opening </p> tag.

like image 526
Glide Avatar asked Mar 09 '11 03:03

Glide


People also ask

How do I search tags in IntelliJ?

on the toolbar, or press Ctrl+F . Enter the tag name (code completion suggests tag names as you type) and press Enter .

How do I open the search bar in IntelliJ?

Press Shift twice to open the search window and type / . IntelliJ IDEA lists the available groups of settings.


2 Answers

  • Ctrl+[ goes to the opening tag
  • Ctrl+] goes to the closing tag

The action is called Move caret to code block end/start and hotkey can be changed in Settings | Keymap.

On IntelliJ 2017 for Mac the shortcuts are:

  • Alt+Command+[ goes to the opening tag
  • Alt+Command+] goes to the closing tag
like image 199
CrazyCoder Avatar answered Sep 21 '22 15:09

CrazyCoder


On IntelliJ 2016 for Mac this command seems to be:

  • Command+Shift+M goes to the matching tag / brace
like image 32
Code Commander Avatar answered Sep 18 '22 15:09

Code Commander