From 665fd3e2dbe20db37fb9d3d1b7efb2db6857db79 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:44:32 -0400 Subject: [PATCH] configure autotags for html --- .config/nvim/lazy-lock.json | 1 + .config/nvim/lua/plugins/autotag.lua | 27 ++++++++++++------------- .config/nvim/lua/plugins/closetag.lua | 3 +++ .config/nvim/lua/plugins/lsp-zero.lua | 3 +++ .config/nvim/lua/plugins/treesitter.lua | 4 ++++ 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 .config/nvim/lua/plugins/closetag.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8d942f5..14e8d37 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -34,6 +34,7 @@ "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, + "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, "vim-floaterm": { "branch": "master", "commit": "6e81602e9d7ff7dc1c96c66fedc38fca1262d57c" }, "vscode-js-debug": { "branch": "main", "commit": "16b9a70171b94cfe4aafc49e991f93b87b8ffb77" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } diff --git a/.config/nvim/lua/plugins/autotag.lua b/.config/nvim/lua/plugins/autotag.lua index 97af870..1f8fcb7 100644 --- a/.config/nvim/lua/plugins/autotag.lua +++ b/.config/nvim/lua/plugins/autotag.lua @@ -1,16 +1,15 @@ return { - "windwp/nvim-ts-autotag", - dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' }, - ft = { - "javascriptreact", - "typescriptreact", - "html" - }, - config = function() - local autotag = require('nvim-ts-autotag') - autotag.setup({ - enable = true, - enable_close_on_slash = false, - }) - end + "windwp/nvim-ts-autotag", + dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' }, + ft = { + 'javascriptreact', + 'typescriptreact', + }, + config = function() + local autotag = require('nvim-ts-autotag') + autotag.setup({ + enable = true, + enable_close_on_slash = false, + }) + end } diff --git a/.config/nvim/lua/plugins/closetag.lua b/.config/nvim/lua/plugins/closetag.lua new file mode 100644 index 0000000..53c62cb --- /dev/null +++ b/.config/nvim/lua/plugins/closetag.lua @@ -0,0 +1,3 @@ +return { + "alvan/vim-closetag" +} diff --git a/.config/nvim/lua/plugins/lsp-zero.lua b/.config/nvim/lua/plugins/lsp-zero.lua index ce26a93..169d1e3 100644 --- a/.config/nvim/lua/plugins/lsp-zero.lua +++ b/.config/nvim/lua/plugins/lsp-zero.lua @@ -73,6 +73,8 @@ return { "typescript", "javascriptreact", "typescriptreact", + "html", + "css", }, }, }) @@ -85,6 +87,7 @@ return { lspconfig.zls.setup({}) lspconfig.rust_analyzer.setup({}) lspconfig.gopls.setup({}) + lspconfig.html.setup({}) end lspzero.setup() diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index f8a6b78..a9e5b7b 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -91,6 +91,10 @@ return { }, }, }, + autotag = { + enable = true, + enable_close_on_slash = false, + } } end }