|
|
@ -1,24 +1,3 @@
|
|
|
|
-- See `:help nvim-treesitter`
|
|
|
|
|
|
|
|
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
|
|
|
|
|
|
|
--[[ vim.defer_fn(function()
|
|
|
|
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
|
|
|
|
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc',
|
|
|
|
|
|
|
|
'vim' },
|
|
|
|
|
|
|
|
auto_install = true,
|
|
|
|
|
|
|
|
highlight = { enable = true },
|
|
|
|
|
|
|
|
indent = { enable = true },
|
|
|
|
|
|
|
|
incremental_selection = { enable = true },
|
|
|
|
|
|
|
|
textobjects = {
|
|
|
|
|
|
|
|
select = { enable = true, lookahead = true },
|
|
|
|
|
|
|
|
move = { enable = true, set_jumps = true },
|
|
|
|
|
|
|
|
swap = { enable = true },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
opts = {
|
|
|
|
|
|
|
|
context_commentstring = { enable = true, enable_autocmd = false },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
end, 0) ]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
-- A list of parser names, or "all"
|
|
|
|
-- A list of parser names, or "all"
|
|
|
|
ensure_installed = {
|
|
|
|
ensure_installed = {
|
|
|
@ -115,6 +94,22 @@ require('nvim-treesitter.configs').setup {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require'treesitter-context'.setup{
|
|
|
|
|
|
|
|
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
|
|
|
|
|
|
|
multiwindow = false, -- Enable multiwindow support.
|
|
|
|
|
|
|
|
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
|
|
|
|
|
|
|
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
|
|
|
|
|
|
|
line_numbers = true,
|
|
|
|
|
|
|
|
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
|
|
|
|
|
|
|
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
|
|
|
|
|
|
|
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
|
|
|
|
|
|
|
-- Separator between context and content. Should be a single character string, like '-'.
|
|
|
|
|
|
|
|
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
|
|
|
|
|
|
|
separator = nil,
|
|
|
|
|
|
|
|
zindex = 20, -- The Z-index of the context window
|
|
|
|
|
|
|
|
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vim.filetype.add {
|
|
|
|
vim.filetype.add {
|
|
|
|
extension = {
|
|
|
|
extension = {
|
|
|
|
templ = 'templ',
|
|
|
|
templ = 'templ',
|
|
|
|