Some checks are pending
Check Lua Formatting in MyRepo / Stylua Check (push) Waiting to run
28 lines
809 B
Lua
28 lines
809 B
Lua
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', '<leader>uc', '<cmd>TSContext toggle<cr>')
|
|
end,
|
|
}
|