How do I jump to the matching tag, when editing HTML in Emacs?

前端 未结 3 511
一生所求
一生所求 2021-01-31 15:57

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 its closing tag?

3条回答
  •  星月不相逢
    2021-01-31 16:19

    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

    or

    C-c

    and bound to the menu bar:

      `
    

    From emacslisp:

    (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.

提交回复
热议问题