{"id":13927082,"url":"https://github.com/alvan/vim-closetag","last_synced_at":"2026-01-11T03:52:53.749Z","repository":{"id":18855849,"uuid":"22072304","full_name":"alvan/vim-closetag","owner":"alvan","description":"Auto close (X)HTML tags","archived":false,"fork":false,"pushed_at":"2024-06-01T16:58:01.000Z","size":36,"stargazers_count":745,"open_issues_count":9,"forks_count":49,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-08T16:15:19.754Z","etag":null,"topics":["automate","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/alvan.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}},"created_at":"2014-07-21T16:50:12.000Z","updated_at":"2024-08-08T16:12:33.000Z","dependencies_parsed_at":"2022-07-25T06:46:59.084Z","dependency_job_id":null,"html_url":"https://github.com/alvan/vim-closetag","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/alvan%2Fvim-closetag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Fvim-closetag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Fvim-closetag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvan%2Fvim-closetag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvan","download_url":"https://codeload.github.com/alvan/vim-closetag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226559384,"owners_count":17651360,"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":["automate","tag","vim"],"created_at":"2024-08-07T16:01:23.870Z","updated_at":"2026-01-11T03:52:53.694Z","avatar_url":"https://github.com/alvan.png","language":"Vim script","funding_links":[],"categories":["Vim Script","Vim script"],"sub_categories":[],"readme":"closetag.vim\n============\n\n### Usage\n\nThe current content:\n\n```vim\n\u003ctable|\n```\n\nNow you press \u003ckbd\u003e\u0026gt;\u003c/kbd\u003e, the content will be:\n\n```vim\n\u003ctable\u003e|\u003c/table\u003e\n```\n\nAnd then if you press \u003ckbd\u003e\u0026gt;\u003c/kbd\u003e again, the content will be:\n\n```vim\n\u003ctable\u003e\n    |\n\u003c/table\u003e\n```\n\nThe following tags will not be closed:\n\n```html\n\u003carea\u003e, \u003cbase\u003e, \u003cbr\u003e, \u003ccol\u003e, \u003ccommand\u003e, \u003cembed\u003e, \u003chr\u003e, \u003cimg\u003e, \n\u003cinput\u003e, \u003ckeygen\u003e, \u003clink\u003e, \u003cmeta\u003e, \u003cparam\u003e, \u003csource\u003e, \u003ctrack\u003e, \u003cwbr\u003e,\u003cmenuitem\u003e\n```\n\n### Installation\n\n* Just put the files into ~/.vim/ or \u0026lt;HOMEDIR\u0026gt;\\vimfiles\\ (for Windows).\n\n* Use vundle:\n\n```vim\nPlugin 'alvan/vim-closetag'\n```\n\n* Use other package manager.\n\n### Commands\n\nUse these commands to toggle/enable/disable this function for the current buffer:\n\n```vim\n:CloseTagToggleBuffer\n:CloseTagEnableBuffer\n:CloseTagDisableBuffer\n```\n\n### Options\n\nSet in your vimrc:\n\n```vim\n\" filenames like *.xml, *.html, *.xhtml, ...\n\" These are the file extensions where this plugin is enabled.\n\"\nlet g:closetag_filenames = '*.html,*.xhtml,*.phtml'\n\n\" filenames like *.xml, *.xhtml, ...\n\" This will make the list of non-closing tags self-closing in the specified files.\n\"\nlet g:closetag_xhtml_filenames = '*.xhtml,*.jsx'\n\n\" filetypes like xml, html, xhtml, ...\n\" These are the file types where this plugin is enabled.\n\"\nlet g:closetag_filetypes = 'html,xhtml,phtml'\n\n\" filetypes like xml, xhtml, ...\n\" This will make the list of non-closing tags self-closing in the specified files.\n\"\nlet g:closetag_xhtml_filetypes = 'xhtml,jsx'\n\n\" integer value [0|1]\n\" This will make the list of non-closing tags case-sensitive (e.g. `\u003cLink\u003e` will be closed while `\u003clink\u003e` won't.)\n\"\nlet g:closetag_emptyTags_caseSensitive = 1\n\n\" dict\n\" Disables auto-close if not in a \"valid\" region (based on filetype)\n\"\nlet g:closetag_regions = {\n    \\ 'typescript.tsx': 'jsxRegion,tsxRegion',\n    \\ 'javascript.jsx': 'jsxRegion',\n    \\ 'typescriptreact': 'jsxRegion,tsxRegion',\n    \\ 'javascriptreact': 'jsxRegion',\n    \\ }\n\n\" Shortcut for closing tags, default is '\u003e'\n\"\nlet g:closetag_shortcut = '\u003e'\n\n\" Add \u003e at current position without closing the current tag, default is ''\n\"\nlet g:closetag_close_shortcut = '\u003cleader\u003e\u003e'\n```\n\n### Note about React fragments\n\nBy default, React fragments are automatically closed **only** when a React file is open.\n\nWhen editing a `.html` file you will get:\n\n```\n\u003c|\n\u003c\u003e|\n```\n\nWhen editing a `.{t,j}sx` file you will get:\n```\n\u003c|\n\u003c\u003e|\u003c/\u003e\n```\n\nTo override this behavior, you can set the global `g:closetag_enable_react_fragment` in your `.vimrc`:\n\n```vim\n\" integer value [0|1]\n\" Enables closing tags for React fragments -\u003e \u003c\u003e\u003c/\u003e for all supported file types\n\"\nlet g:closetag_enable_react_fragment = 1\n\" Disable closing tags for React fragments -\u003e \u003c\u003e\u003c/\u003e for all supported file types\n\"\nlet g:closetag_enable_react_fragment = 0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvan%2Fvim-closetag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvan%2Fvim-closetag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvan%2Fvim-closetag/lists"}