From c1e89be0a71bd6fc4d85ba30ecb37789d30fca18 Mon Sep 17 00:00:00 2001 From: Mora Unie Youer Date: Thu, 6 Mar 2025 17:10:34 +0300 Subject: feat: add `treesitter` --- flake.nix | 1 + lua/config/plugins/treesitter.lua | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 679cedd..c5ec6cd 100644 --- a/flake.nix +++ b/flake.nix @@ -128,6 +128,7 @@ general = with pkgs.vimPlugins; { leap = [ leap-nvim flit-nvim ]; telescope = [ telescope-nvim ]; + treesitter = [ nvim-treesitter.withAllGrammars nvim-treesitter-textobjects ]; extra = [ which-key-nvim ]; }; }; diff --git a/lua/config/plugins/treesitter.lua b/lua/config/plugins/treesitter.lua index a564707..8e3df6a 100644 --- a/lua/config/plugins/treesitter.lua +++ b/lua/config/plugins/treesitter.lua @@ -1 +1,16 @@ -return {} +return { + { + "nvim-treesitter", + event = "DeferredUIEnter", + load = function(name) + vim.cmd.packadd(name) + vim.cmd.packadd("nvim-treesitter-textobjects") + end, + after = function(_) + require("nvim-treesitter.configs").setup({ + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, +} -- cgit v1.2.3-70-g09d2