|
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 | | - |
22 | 1 | require('nvim-treesitter.configs').setup { |
23 | 2 | -- A list of parser names, or "all" |
24 | 3 | ensure_installed = { |
@@ -115,6 +94,22 @@ require('nvim-treesitter.configs').setup { |
115 | 94 | }, |
116 | 95 | } |
117 | 96 |
|
| 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 | + |
118 | 113 | vim.filetype.add { |
119 | 114 | extension = { |
120 | 115 | templ = 'templ', |
|
0 commit comments