Can Vim highlight matching HTML tags like Notepad++?

前端 未结 3 1093
面向向阳花
面向向阳花 2020-12-22 15:15

Vim has support for matching pairs of curly brackets, parentheses, and square brackets. This is great for editing C-style languages like PHP and JavaScript. But what about m

相关标签:
3条回答
  • 2020-12-22 15:19

    I came here looking for matching html style angle brackets in Vim. This seems to work:

    :set mps+=<:>
    :help matchpairs
    
    0 讨论(0)
  • 2020-12-22 15:36

    Greg's MatchTag.vim plugin is awesome, but I wanted something more. I wanted the enclosing tags to always be highlighted, not just when the cursor is on one of the tags.

    So I wrote MatchTagAlways which does everything that Greg's MatchTag does and also always highlights the enclosing tag, no matter where the cursor is in the code. It also works with unclosed tags and HTML templating languages like Jinja or Handlebars.

    Here's a GIF showing it in action:

    MTA in action

    0 讨论(0)
  • 2020-12-22 15:43

    I had to work with some HTML today so thought I would tackle this. Added a ftplugin to vim.org that should solve your problem.

    You can get it here on vim.org.

    You can get it here on github.

    Hope it works for you. Let me know if you have any problems.

    0 讨论(0)
提交回复
热议问题