{"id":16227632,"url":"https://github.com/leafoftree/vim-matchtag","last_synced_at":"2025-07-13T04:33:35.251Z","repository":{"id":38951222,"uuid":"284860872","full_name":"leafOfTree/vim-matchtag","owner":"leafOfTree","description":"Highlight matching tags in any files such as html, xml, js, jsx, vue, svelte.","archived":false,"fork":false,"pushed_at":"2024-10-21T03:30:54.000Z","size":41,"stargazers_count":32,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T18:48:17.902Z","etag":null,"topics":["highlight","html","matchtag","tag","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leafOfTree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-04T02:50:38.000Z","updated_at":"2024-12-21T01:45:03.000Z","dependencies_parsed_at":"2024-10-22T06:14:13.342Z","dependency_job_id":null,"html_url":"https://github.com/leafOfTree/vim-matchtag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fvim-matchtag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fvim-matchtag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fvim-matchtag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafOfTree%2Fvim-matchtag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafOfTree","download_url":"https://codeload.github.com/leafOfTree/vim-matchtag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989730,"owners_count":20379648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["highlight","html","matchtag","tag","vim"],"created_at":"2024-10-10T12:53:22.200Z","updated_at":"2025-03-19T13:31:07.205Z","avatar_url":"https://github.com/leafOfTree.png","language":"Vim Script","readme":"\u003cimg src=\"https://raw.githubusercontent.com/leafOfTree/leafOfTree.github.io/master/vim-matchtag.svg\" width=\"60\" height=\"60\" alt=\"icon\" align=\"left\"/\u003e\n\n# vim-matchtag\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"screenshot\" src=\"https://raw.githubusercontent.com/leafOfTree/leafOfTree.github.io/master/vim_matchtag_single.png\" height=\"135\" /\u003e\n\u003cimg alt=\"screenshot\" src=\"https://raw.githubusercontent.com/leafOfTree/leafOfTree.github.io/master/vim_matchtag_both.png\" height=\"135\" /\u003e\n\u003cimg alt=\"screenshot\" src=\"https://raw.githubusercontent.com/leafOfTree/leafOfTree.github.io/master/vim_matchtag_both_react.png\" height=\"135\" /\u003e\n\u003c/p\u003e\n\nHighlight matching tags in any files such as html, xml, js, jsx, vue, svelte.\n\n## Installation\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ca\u003eHow to install\u003c/a\u003e\u003c/summary\u003e\n\n- [VundleVim][1]\n\n        Plugin 'leafOfTree/vim-matchtag'\n\n- [vim-pathogen][2]\n\n        cd ~/.vim/bundle \u0026\u0026 \\\n        git clone https://github.com/leafOfTree/vim-matchtag --depth 1\n\n- [vim-plug][3]\n\n        Plug 'leafOfTree/vim-matchtag'\n\n- Or manually, clone this plugin to `path/to/this_plugin`, and add it to `rtp` in vimrc\n\n        set rtp+=path/to/this_plugin\n\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## How it works\n\nThis plugin finds the matching tag and highlight it. Mainly inspired by vim builtin `matchparen` using `searchpairpos` and `matchaddpos`. Feel free to open an issue or a pull request.\n\n## Configuration\n\nSet global variable to `1` to enable or `0` to disalbe. Or a proper value to make it effective. Ex:\n\n```vim\nlet g:vim_matchtag_enable_by_default = 1\nlet g:vim_matchtag_files = '*.html,*.xml,*.js,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.jsp,*.php,*.erb,*.astro'\n```\n\n| variable                             | description                                         | default |\n|--------------------------------------|-----------------------------------------------------|---------|\n| g:vim_matchtag_files               | Enable on these files.                              | *See ^* |\n| g:vim_matchtag_enable_by_default   | Enable by default.                                  | 1       |\n| g:vim_matchtag_highlight_cursor_on | Highlight the tag when the cursor is on it. | 0       |\n| **Mappings / Performance / debug related** |||\n| g:vim_matchtag_mapping_toggle                     | Key mapping to toggle highlighting.                     | `''`    |\n| g:vim_matchtag_mapping_toggle_highlight_cursor_on | Key mapping to toggle `highlight_cursor_on`. | `''`    |\n| g:vim_matchtag_skip          | Syntax to skip.                                                                       | *See +* |\n| g:vim_matchtag_skip_except   | Syntax not to skip.                                                                   | *See +* |\n| g:vim_matchtag_timeout       | The search stops after timeout milliseconds.                                          | 50      |\n| g:vim_matchtag_disable_cache | Disable the cache for lines. \u003cbr\u003e(By default the lines are cached until text changed) | 0       |\n| g:vim_matchtag_debug         | Echo debug messages.                                                                  | 0       |\n\n**Note**\n\n- If you prefer to enable it on demand, you can set `g:vim_matchtag_enable_by_default` to `0` then toggle it by `:MatchTagToggle`.\n\n- ^: It is a comma separated file pattern (`:h autocmd-patterns`). It defaults to\n\n    ```vim\n    let g:vim_matchtag_files = '*.html,*.xml,*.js,*.jsx,*.ts,*.tsx,*.vue,*.svelte,*.jsp,*.php,*.erb,*.astro'\n    ```\n- +: Both are patterns (`:h pattern`). The default values are\n\n    ```vim\n    let g:vim_matchtag_skip = 'javascript\\|css\\|script\\|style'\n    let g:vim_matchtag_skip_except = 'html\\|template'\n    ```\n- See [performance](#performance) if there are lags.\n\n### Highlighting\n\nWhen the matching tag is found, the highlight group is `matchTag` (by default `Visual`). Otherwise, it's `matchTagError` (by default `Error`).\n\nYou could change them as follows.\n\n```vim\nhighlight link matchTag Search\nhighlight link matchTag MatchParen\nhighlight matchTag gui=reverse\n\nhighlight link matchTagError Todo\n```\n\nIf these don't take effect, try putting them at the end of your vimrc.\n\n### Commands\n\nThere are commands you can call directly or add key mapping to.\n\n- `:MatchTagToggle` Toggle highlighting.\n\n- `:MatchTagToggleHighlightCursorOn` Toggle highlighting of the tag when the cursor is on it.\n\n## Performance\n\nThe highlighting should take about `0.001`~`0.01` depending on the file content. If there is a freeze, you can try \n\n```vim\nlet g:vim_matchtag_skip = '\u003cpattern\u003e'         \" Syntax to skip\nlet g:vim_matchtag_skip_except = '\u003cpattern\u003e'  \" Syntax not to skip\n\ncall matchtag#ReportTime()\n```\nand feel free to open an issue.\n\nYou can show the syntax stack under the cursor by running\n```vim\necho map(synstack(line('.'), col('.')), { _, id -\u003e synIDattr(id, 'name') })\n```\n\n## Others\n\n- Jump between matching tags? See `:h matchit`.\n\n## Credits\n\n- matchparen.vim\n\n[1]: https://github.com/VundleVim/Vundle.vim\n[2]: https://github.com/tpope/vim-pathogen\n[3]: https://github.com/junegunn/vim-plug\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafoftree%2Fvim-matchtag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafoftree%2Fvim-matchtag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafoftree%2Fvim-matchtag/lists"}