return { 'nvim-treesitter/nvim-treesitter-context', event = 'BufReadPost', config = function() require('treesitter-context').setup({ max_lines = 3, multiwindow = false, multiline_threshold = 1, trim_scope = 'inner', mode = 'cursor', -- faster than 'cursor' separator = '─', on_attach = function(buf) -- disable for large files if vim.api.nvim_buf_line_count(buf) > 3000 then return false end -- disable for specific filetypes local disabled = { 'markdown', 'text', 'help', 'json', 'yaml' } if vim.tbl_contains(disabled, vim.bo[buf].filetype) then return false end return true end, }) vim.keymap.set('n', 'uc', 'TSContext toggle') end, }