Skip to content

Commit 84120d1

Browse files
committed
Adding autoclosing of html tags in tsx files
1 parent f84ddba commit 84120d1

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

lazy-lock.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
2929
"nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
3030
"nvim-treesitter-textobjects": { "branch": "main", "commit": "4e91b5d0394329a229725b021a8ea217099826ef" },
31+
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
3132
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
3233
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
3334
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
return {
2+
'windwp/nvim-ts-autotag',
3+
-- event = { 'BufReadPre', 'BufNewFile' },
4+
opts = {
5+
-- Defaults
6+
-- enable_close = true, -- Auto close tags
7+
-- enable_rename = true, -- Auto rename pairs of tags
8+
-- enable_close_on_slash = false, -- Auto close on trailing </
9+
},
10+
-- config = function(_, opts)
11+
-- require('nvim-ts-autotag').setup(opts)
12+
-- end,
13+
}

lua/kickstart/plugins/treesitter.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ return {
55
branch = 'main',
66
build = ':TSUpdate',
77
opts = {},
8+
-- dependencies = {
9+
-- 'windwp/nvim-ts-autotag', -- auto close tsx tags
10+
-- },
11+
-- opts = {
12+
-- autotag = {
13+
-- -- Setup autotag using treesitter config.
14+
-- enable = true,
15+
-- },
16+
-- },
817
-- main = 'nvim-treesitter.configs', -- Sets main module to use for opts
918
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
1019
config = function(_, opts)
@@ -28,6 +37,7 @@ return {
2837
'yaml',
2938
'ecma',
3039
'typescript',
40+
'tsx',
3141
}
3242
local alreadyInstalled = require('nvim-treesitter').get_installed 'parsers'
3343
local parsersToInstall = vim

lua/lazy-plugins.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ require('lazy').setup({
6464
require 'custom/plugins/theme',
6565
require 'custom/plugins/indent-blankline',
6666
require 'custom/plugins/leetcode',
67+
require 'custom/plugins/ts-tag-autoclose',
6768

6869
--
6970
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`

0 commit comments

Comments
 (0)