From 1e47459801302bd5a7c33c0bbd375f436ae56615 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 12 Dec 2023 12:04:53 +0100 Subject: [PATCH] nvim: Add endwise plugin to treesitter Will automatically add function end tags for a bunch of languages, most importantly for me to lua and bash. --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/treesitter.lua | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index daa4876..4e44088 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -60,6 +60,7 @@ "nvim-tree.lua": { "branch": "master", "commit": "7d1760f892951dd6a118dae1d7a1d8df5f029edf" }, "nvim-treesitter": { "branch": "master", "commit": "63260da18bf273c76b8e2ea0db84eb901cab49ce" }, "nvim-treesitter-context": { "branch": "master", "commit": "bf4d15ee4e96ff5201f16a4ed14443670662eb90" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "011c09784f1a95cf469a48c1993b664190440391" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index 6afa8ed..e543e83 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -13,9 +13,9 @@ return { language_tree = true, disable = function(_, bufnr) if - vim.api.nvim_buf_line_count(bufnr) > 1000 + vim.api.nvim_buf_line_count(bufnr) > 1000 or vim.fn.strwidth(vim.fn.getline(".")) > 300 - or vim.fn.getfsize(vim.fn.expand("%")) > 1024*1024 + or vim.fn.getfsize(vim.fn.expand("%")) > 1024 * 1024 then return true end @@ -42,6 +42,10 @@ return { [";"] = "textsubjects-container-outer", }, }, + + endwise = { + enable = true + } }) -- for improved commentstrings, needs corresponding plugin @@ -90,10 +94,10 @@ return { "https://gitlab.com/HiPhish/nvim-ts-rainbow2.git", { "romgrk/nvim-treesitter-context", config = true }, "JoosepAlviste/nvim-ts-context-commentstring", - { - "RRethy/nvim-treesitter-textsubjects", - }, + "RRethy/nvim-treesitter-textsubjects", "windwp/nvim-ts-autotag", + "RRethy/nvim-treesitter-endwise", }, }, } +