From c5e788a3f191a75c700042776cd03c1c320e197f Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 6 Sep 2024 12:35:39 +0200 Subject: [PATCH] nvim: treesitter: move autotag config to lang files. --- nvim/lua/user/plugins/editor/treesitter.lua | 20 +---------------- nvim/lua/user/plugins/lang/html.lua | 9 ++++++++ nvim/lua/user/plugins/lang/markdown.lua | 11 ++++++++- nvim/lua/user/plugins/lang/php.lua | 25 +++++++++++++++++++++ nvim/lua/user/plugins/lang/typescript.lua | 12 ++++++++++ nvim/lua/user/plugins/lang/vue.lua | 9 ++++++++ 6 files changed, 66 insertions(+), 20 deletions(-) diff --git a/nvim/lua/user/plugins/editor/treesitter.lua b/nvim/lua/user/plugins/editor/treesitter.lua index 0bcf3ce..b62365e 100644 --- a/nvim/lua/user/plugins/editor/treesitter.lua +++ b/nvim/lua/user/plugins/editor/treesitter.lua @@ -7,25 +7,7 @@ return { -- "nvim-treesitter/nvim-treesitter-textobjects", { "windwp/nvim-ts-autotag", - opts = { - -- Filetypes to enable autotag for - filetypes = { - 'html', - 'javascript', - 'typescript', - 'javascriptreact', - 'typescriptreact', - 'svelte', - 'vue', - 'tsx', - 'jsx', - 'rescript', - 'xml', - 'php', - 'blade', - 'markdown', - }, - }, + opts = {} }, }, opts_extend = { "ensure_installed" }, diff --git a/nvim/lua/user/plugins/lang/html.lua b/nvim/lua/user/plugins/lang/html.lua index 2a5d73c..1fe974c 100644 --- a/nvim/lua/user/plugins/lang/html.lua +++ b/nvim/lua/user/plugins/lang/html.lua @@ -4,5 +4,14 @@ return { opts = { ensure_installed = { "html" } } + }, + { + "windwp/nvim-ts-autotag", + optional = true, + opts = { + filetypes = { + 'html', + } + } } } diff --git a/nvim/lua/user/plugins/lang/markdown.lua b/nvim/lua/user/plugins/lang/markdown.lua index e8a14ca..18cdd21 100644 --- a/nvim/lua/user/plugins/lang/markdown.lua +++ b/nvim/lua/user/plugins/lang/markdown.lua @@ -8,7 +8,16 @@ return { opts = { ensure_installed = { "markdown" } } - } + }, + { + "windwp/nvim-ts-autotag", + optional = true, + opts = { + filetypes = { + 'markdown', + }, + }, + }, }, opts = { code = { diff --git a/nvim/lua/user/plugins/lang/php.lua b/nvim/lua/user/plugins/lang/php.lua index dd40177..320516e 100644 --- a/nvim/lua/user/plugins/lang/php.lua +++ b/nvim/lua/user/plugins/lang/php.lua @@ -16,6 +16,16 @@ return { ensure_installed = { "php", "phpdoc" } } }, + { + "windwp/nvim-ts-autotag", + optional = true, + opts = { + filetypes = { + 'php', + 'blade', + } + } + }, { "neovim/nvim-lspconfig", ft = { "php" }, @@ -23,6 +33,21 @@ return { servers = lspservers }, }, + { + "nvim-neotest/neotest", + optional = true, + ft = { "php" }, + dependencies = { + "olimorris/neotest-phpunit", + 'V13Axel/neotest-pest', + }, + opts = { + adapters = { + "neotest-phpunit", + "neotest-pest", + } + }, + }, { "adalessa/laravel.nvim", dependencies = { diff --git a/nvim/lua/user/plugins/lang/typescript.lua b/nvim/lua/user/plugins/lang/typescript.lua index 517c618..6b5c887 100644 --- a/nvim/lua/user/plugins/lang/typescript.lua +++ b/nvim/lua/user/plugins/lang/typescript.lua @@ -9,6 +9,18 @@ return { ensure_installed = { "typescript" } } }, + { + "windwp/nvim-ts-autotag", + optional = true, + opts = { + filetypes = { + 'javascript', + 'typescript', + 'tsx', + 'jsx' + }, + }, + }, { "neovim/nvim-lspconfig", ft = { "ts" }, diff --git a/nvim/lua/user/plugins/lang/vue.lua b/nvim/lua/user/plugins/lang/vue.lua index 53da9b6..74e891d 100644 --- a/nvim/lua/user/plugins/lang/vue.lua +++ b/nvim/lua/user/plugins/lang/vue.lua @@ -20,6 +20,15 @@ return { ensure_installed = { "vue" } } }, + { + "windwp/nvim-ts-autotag", + optional = true, + opts = { + filetypes = { + 'vue', + }, + }, + }, { "neovim/nvim-lspconfig", ft = { "vue" },