From 7c2b42d916dab762292cc01de0b63d55b320e9d6 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Thu, 5 Mar 2026 18:35:56 +0100 Subject: [PATCH] feat: move to new treesitter. --- ftplugin/bash.lua | 1 + ftplugin/go.lua | 1 + ftplugin/html.lua | 1 + ftplugin/json.lua | 1 + ftplugin/just.lua | 1 + ftplugin/lua.lua | 1 + ftplugin/markdown.lua | 1 + ftplugin/nix.lua | 1 + ftplugin/python.lua | 1 + ftplugin/yaml.lua | 1 + ftplugin/zsh.lua | 1 + lua/plugins/lsp.lua | 6 +++--- lua/plugins/treesitter.lua | 24 +++--------------------- nvim-pack-lock.json | 4 ++-- 14 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 ftplugin/bash.lua create mode 100644 ftplugin/go.lua create mode 100644 ftplugin/html.lua create mode 100644 ftplugin/json.lua create mode 100644 ftplugin/just.lua create mode 100644 ftplugin/lua.lua create mode 100644 ftplugin/markdown.lua create mode 100644 ftplugin/nix.lua create mode 100644 ftplugin/python.lua create mode 100644 ftplugin/yaml.lua create mode 100644 ftplugin/zsh.lua diff --git a/ftplugin/bash.lua b/ftplugin/bash.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/bash.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/go.lua b/ftplugin/go.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/go.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/html.lua b/ftplugin/html.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/html.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/json.lua b/ftplugin/json.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/json.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/just.lua b/ftplugin/just.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/just.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/lua.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/markdown.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/nix.lua b/ftplugin/nix.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/nix.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/python.lua b/ftplugin/python.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/python.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/yaml.lua b/ftplugin/yaml.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/yaml.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua new file mode 100644 index 0000000..fe6caae --- /dev/null +++ b/ftplugin/zsh.lua @@ -0,0 +1 @@ +vim.treesitter.start() diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 7fa01fe..8f0b6ee 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -16,6 +16,9 @@ vim.lsp.config("*", { root_markers = { '.git' }, }) +-- fix annoying lua lsp errors +require("lazydev").setup() + -- enable specific language servers vim.lsp.enable({ "nixd", @@ -33,6 +36,3 @@ vim.lsp.enable({ -- diagnostic settings vim.diagnostic.config({ virtual_text = true }) - --- fix annoying lua lsp errors -require("lazydev").setup() diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 6ead4ba..4284957 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,28 +1,10 @@ vim.pack.add({ - { src = "https://github.com/nvim-treesitter/nvim-treesitter", name = "nvim-treesitter" }, + { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, }) ---@diagnostic disable: missing-fields -require'nvim-treesitter'.setup { - -- ensure_installed = { "go", "nix" }, +require 'nvim-treesitter'.setup {} - auto_install = true, - - highlight = { - enable = true, - }, - - incremental_selection = { - enable = true, - keymaps = { - init_selection = "ss", - node_incremental = "si", - scope_incremental = "sc", - node_decremental = "sd", - }, - }, -} - -require'nvim-treesitter'.install { 'go', 'nix'} +require 'nvim-treesitter'.install { 'go', 'nix', 'lua', 'json', 'html', 'markdown_inline', 'python', 'bash', 'zsh', 'just', 'yaml' } -- run tsupdate when updating nvim-treesitter vim.api.nvim_create_autocmd('PackChanged', { diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 7d5a219..c2b0c09 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -25,11 +25,11 @@ "src": "https://github.com/neovim/nvim-lspconfig" }, "nvim-treesitter": { - "rev": "cb2cb74f3c3cbbcc17e79cada2060165d616d849", + "rev": "544320a9cf5d6bf539ec1cc54d393064015670c4", "src": "https://github.com/nvim-treesitter/nvim-treesitter" }, "render-markdown.nvim": { - "rev": "1641b434bda26e0f4e3610985b3357fc213cf834", + "rev": "bd482f9a4827c9422231a7db1439c5cff1e69ae0", "src": "https://github.com/MeanderingProgrammer/render-markdown.nvim" }, "rose-pine": {