From 8a8c63ac4b70aeb1f4abf8d4cca4ebe7f333294d Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 6 Apr 2024 01:01:40 +0200 Subject: [PATCH] feat: add treesitter-context nvim plugin --- modules/home-manager/cli/neovim/default.nix | 6 ++++++ .../cli/neovim/files/treesitter_context.lua | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 modules/home-manager/cli/neovim/files/treesitter_context.lua diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 57985f9..8b90b0e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -121,6 +121,12 @@ in type = "lua"; config = ( builtins.readFile ./files/treesitter.lua); } + { + plugin = nvim-treesitter-context; + type = "lua"; + config = ( builtins.readFile ./files/treesitter_context.lua); + + } { plugin = which-key-nvim; type = "lua"; diff --git a/modules/home-manager/cli/neovim/files/treesitter_context.lua b/modules/home-manager/cli/neovim/files/treesitter_context.lua new file mode 100644 index 0000000..d2d2b43 --- /dev/null +++ b/modules/home-manager/cli/neovim/files/treesitter_context.lua @@ -0,0 +1,12 @@ +require('treesitter-context').setup{ + enable = true, + max_lines = 0, + min_window_height = 0, + line_numbers = true, + multiline_threshold = 20, + trim_scope = 'outer', + mode = 'cursor', + separator = nil, + zindex = 20, + on_attach = nil, +}