Is there a shortcut to jump from, e.g, <XX> to </XX>?
I already gave it a try with %, but it doesn't work in this situation.
Is there a shortcut to jump from, e.g, <XX> to </XX>?
I already gave it a try with %, but it doesn't work in this situation.
You can jump between tags using visual operators, for example:
Your cursor should jump forward to the matching closing HTML/XML tag. To jump backwards from closing tag, press o or O to jump to the opposite tag.
Now you can either exit visual selection by pressing Esc, change it with c or copy it with y.
To record that action into a register, press qq to start recording, perform the tag jump as above (including Esc), press q to finish. Then to invoke the jump, press @q.
See more help at :help visual-operators or :help v_it:
at a
<tag> </tag>block (with tags)it inner
<tag> </tag>block
Alternatively, use a plugin such as matchit.vim (See: Using % in languages without curly braces).
See also:
matchit plugin (see :help matchit-install for instructions).:filetype plugin on). Henceforth, whenever you edit a file detected as xml or html or some other tag-based markup language, the combination of the matchit plugin and the filetype plugin files will allow the % motion to match open and close tags.