diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index e2ec1ea..e927f15 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -45,7 +45,7 @@ return { "nvim-neotest/nvim-nio", "nvim-lua/plenary.nvim", "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", + "romus204/tree-sitter-manager.nvim", }, }, { -- Tools for configuration and plugin development @@ -69,81 +69,31 @@ return { end, keys = require("config.keys").overseer, }, - { -- Highlight, edit, and navigate code - "nvim-treesitter/nvim-treesitter", - branch = "main", - build = ":TSUpdate", - opts = { - ensure_installed = { - "bash", - "c", - "elixir", - "html", - "lua", - "markdown", - "nix", - "nu", - "python", - "quarto", - "rust", - "scheme", - "typst", - "vim", - "vimdoc", - }, - auto_install = true, - highlight = { enable = true }, - indent = { enable = true }, - }, + { + "romus204/tree-sitter-manager.nvim", + dependencies = {}, config = function() - local treesitter = require("nvim-treesitter") - treesitter.setup() - treesitter.install = { - "bash", - "c", - "elixir", - "html", - "lua", - "markdown", - "nix", - "nu", - "python", - "quarto", - "rust", - "scheme", - "typst", - "vim", - "vimdoc", - } - - vim.api.nvim_create_autocmd("FileType", { - pattern = "*", - callback = function(args) - local ft = vim.bo[args.buf].filetype - if ft == "" or vim.bo[args.buf].buftype ~= "" then - return - end - - local lang = vim.treesitter.language.get_lang(ft) or ft - - if not vim.treesitter.language.add(lang) then - vim.notify( - "Installing Treesitter parser for: " .. lang, - vim.log.levels.INFO - ) - require("nvim-treesitter.install").install(lang, true):wait(function() - vim.schedule(function() - pcall(vim.treesitter.start, args.buf, lang) - end) - end) - return - end - - local success = pcall(vim.treesitter.start, args.buf, lang) - if success then - vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - end - end, + require("tree-sitter-manager").setup({ + ensure_installed = { + "bash", + "c", + "elixir", + "html", + "lua", + "markdown", + "nix", + "nu", + "python", + "quarto", + "rust", + "scheme", + "typst", + "vim", + "vimdoc", + }, + border = nil, + auto_install = false, + highlight = true, }) end, }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 3ad28d0..bf58f8f 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -41,7 +41,7 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", - "nvim-treesitter/nvim-treesitter", + "romus204/tree-sitter-manager.nvim", }, opts = function() local target_path = vim.fn.expand("~/Documents/Work_Notes/") diff --git a/lua/plugins/lang/markdown.lua b/lua/plugins/lang/markdown.lua index 58cf07d..64d9814 100644 --- a/lua/plugins/lang/markdown.lua +++ b/lua/plugins/lang/markdown.lua @@ -4,7 +4,7 @@ return { opts = {}, ft = "markdown", dependencies = { - "nvim-treesitter/nvim-treesitter", + "romus204/tree-sitter-manager.nvim", "echasnovski/mini.nvim", "nvim-tree/nvim-web-devicons", }, diff --git a/lua/plugins/lang/quarto.lua b/lua/plugins/lang/quarto.lua index 5a65236..ad7b8a3 100644 --- a/lua/plugins/lang/quarto.lua +++ b/lua/plugins/lang/quarto.lua @@ -3,7 +3,7 @@ return { "quarto-dev/quarto-nvim", dependencies = { "jmbuhr/otter.nvim", - "nvim-treesitter/nvim-treesitter", + "romus204/tree-sitter-manager.nvim", }, }, }