From 8ae0bf90a78e27018d687c75a6541e8236cd95a3 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Sat, 25 May 2024 11:15:27 +0200 Subject: [PATCH] Tweak treesitter context to show fewer lines, and to trim inner rather than outer when max is exceeding --- home/.config/nvim/lua/plugs/treesitter.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/.config/nvim/lua/plugs/treesitter.lua b/home/.config/nvim/lua/plugs/treesitter.lua index 6221a74..6929b19 100644 --- a/home/.config/nvim/lua/plugs/treesitter.lua +++ b/home/.config/nvim/lua/plugs/treesitter.lua @@ -68,5 +68,11 @@ return { }, }, }) + + require("treesitter-context").setup({ + max_lines = 2, -- How many lines the window should span. Values <= 0 mean no limit. + multiline_threshold = 3, -- Maximum number of lines to show for a single context + trim_scope = "inner", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + }) end, }