treesitter-context.lua (1166B)
1 if not pcall(require, 'treesitter-context') then 2 return 3 end 4 5 require 'treesitter-context'.setup { 6 -- enable = false, -- 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 = 5, -- Maximum number of lines to show for a single context 11 trim_scope = 'inner', -- 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 = '─', 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 20 vim.keymap.set('n', ',x', require('treesitter-context').go_to_context, { silent = true })