tags:

views:

219

answers:

2

Suppose I'm editing a very long and messy HTML file. With my cursor at an open tag, is there a way to jump to it's closing tag?

+3  A: 

Assuming you're using nxml-mode:

C-M-n runs the command nxml-forward-element, which is an interactive
compiled Lisp function in `nxml-mode.el'.

It is bound to C-M-n.

(nxml-forward-element &optional ARG)

Move forward over one element.
With ARG, do it that many times.
Negative ARG means move backward.
nullptr
+1  A: 

And if you're using sgml-mode or its derivatives (e.g. html-mode):

sgml-skip-tag-forward is an interactive compiled Lisp function in `sgml-mode.el'.

It is bound to C-c C-f, C-c <right>, <menu-bar> <sgml> <sgml-skip-tag-forward>.

(sgml-skip-tag-forward arg)

Skip to end of tag or matching closing tag if present. With prefix argument arg, repeat this arg times. Return t if after a closing tag.

Török Gábor