Skip to content

Commit 3c03d41

Browse files
committed
updated treesitter
1 parent fef8f59 commit 3c03d41

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

after/plugin/treesitter-config.lua

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
-- See `:help nvim-treesitter`
2-
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
3-
--[[ vim.defer_fn(function()
4-
require('nvim-treesitter.configs').setup {
5-
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc',
6-
'vim' },
7-
auto_install = true,
8-
highlight = { enable = true },
9-
indent = { enable = true },
10-
incremental_selection = { enable = true },
11-
textobjects = {
12-
select = { enable = true, lookahead = true },
13-
move = { enable = true, set_jumps = true },
14-
swap = { enable = true },
15-
},
16-
opts = {
17-
context_commentstring = { enable = true, enable_autocmd = false },
18-
},
19-
}
20-
end, 0) ]]
21-
221
require('nvim-treesitter.configs').setup {
232
-- A list of parser names, or "all"
243
ensure_installed = {
@@ -115,6 +94,22 @@ require('nvim-treesitter.configs').setup {
11594
},
11695
}
11796

97+
require'treesitter-context'.setup{
98+
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
99+
multiwindow = false, -- Enable multiwindow support.
100+
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
101+
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
102+
line_numbers = true,
103+
multiline_threshold = 20, -- Maximum number of lines to show for a single context
104+
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
105+
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
106+
-- Separator between context and content. Should be a single character string, like '-'.
107+
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
108+
separator = nil,
109+
zindex = 20, -- The Z-index of the context window
110+
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
111+
}
112+
118113
vim.filetype.add {
119114
extension = {
120115
templ = 'templ',

0 commit comments

Comments
 (0)