- Update copilot.lua, copilot-chat.lua AI integrations - Refactor jupytext.lua, slime.lua, venv-selector.lua for Python dev - Update dadbod.lua database tools, vimtex.lua LaTeX support - Clean up context.lua, render-markdown.lua, solarized.lua, monokai.lua - Update auto-dark-mode.lua, undotree.lua
28 lines
810 B
Lua
Executable file
28 lines
810 B
Lua
Executable file
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 'topline'
|
|
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,
|
|
}
|