Vim plugin for better XML/HTML navigation?

前端 未结 2 1169
我在风中等你
我在风中等你 2021-02-05 16:52

I\'m wondering if anybody knows of a Vim plugin that can handle cursor movement between parent/child/sibling elements on either HTML or XML files (preferably both).

2条回答
  •  无人及你
    2021-02-05 17:13

    Matchit.vim does some of what you want. It jumps between opening and closing XML/HTML tags when you press the % key. But there are some tags where it adds a special behaviour. For example, if your cursor is on a

      tag, pressing % will move your cursor forward to the next
    • tag, and so on until you reach the closing
    tag where % causes you to jump back to the opening tag.

    Matchit is distributed with Vim, so you don't have to install it. But you do have to enable it by putting this in your vimrc file:

    runtime macros/matchit.vim
    

提交回复
热议问题