I'm using emacs with nxhtml to edit my HTML files but I can't find out how to highlight or jump to the closing HTML tag?
It sounds like an easy and stupid question but i really can't find it. Maybe I'm not looking for the right thing.
In nxhtml-mode
, C-hm should indicate the following bindings:
<C-M-down> nxml-down-element
<C-M-left> nxml-backward-element
<C-M-right> nxml-forward-element
<C-M-up> nxml-backward-up-element
The forward and backward functions are what you're asking about, while the up and down functions let you move to the parent or child element in the hierarchy.
The sgml-mode
answer is more robust for HTML (as opposed to well-formed XHTML), but you may want to add autoloads for those functions if you'll be using them in nxhtml-mode
, as the latter does not require the former.
(autoload 'sgml-skip-tag-forward "sgml-mode"
"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)
(autoload 'sgml-skip-tag-backward "sgml-mode"
"Skip to beginning of tag or matching opening tag if present.
With prefix argument ARG, repeat this ARG times.
Return non-nil if we skipped over matched tags." t)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With