Search code examples
intellij-idea

IntelliJ IDEA find matching markup tag


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.


Solution

    • 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