From 053d1f905e40d8927a6f72e874a59071555fdc39 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 2 Apr 2024 23:08:02 +0200 Subject: [PATCH] [neovim] add nvim-treesitter --- nix/home/neovim/neovim.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nix/home/neovim/neovim.nix b/nix/home/neovim/neovim.nix index c59f430..edd44e7 100644 --- a/nix/home/neovim/neovim.nix +++ b/nix/home/neovim/neovim.nix @@ -68,6 +68,7 @@ vim.opt.smartindent = true -- load plugins + -- neo-tree require("neo-tree").setup({ filesystem = { filtered_items = { @@ -82,6 +83,21 @@ }) require("neo-tree.sources.manager").show("filesystem") + -- nvim-treesitter + require("nvim-treesitter").setup({ + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { "ansible", "css", "lua", "nix,", "yaml" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end + }) + + -- function for new line _G.add_new_line = function() local n_lines = vim.api.nvim_buf_line_count(0) @@ -115,6 +131,7 @@ # plugins plugins = with pkgs.vimPlugins; [ neo-tree-nvim + nvim-treesitter ]; }; }