Skip to content

Commit c007f08

Browse files
committed
Add Treesitter Context package
Shows a line for the containing class and function when they don't fit on the screen.
1 parent 457af1f commit c007f08

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
return {
2+
'nvim-treesitter/nvim-treesitter-context',
3+
config = function ()
4+
require('treesitter-context').setup {
5+
-- See options here: https://github.com/nvim-treesitter/nvim-treesitter-context?tab=readme-ov-file#configuration
6+
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
7+
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
8+
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
9+
line_numbers = true,
10+
multiline_threshold = 20, -- Maximum number of lines to show for a single context
11+
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
12+
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
13+
-- Separator between context and content. Should be a single character string, like '-'.
14+
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
15+
separator = nil,
16+
zindex = 20, -- The Z-index of the context window
17+
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
18+
}
19+
end
20+
}

0 commit comments

Comments
 (0)