| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- return {
- {
- "nvim-treesitter/nvim-treesitter",
- enabled = true,
- lazy = false,
- config = function(_, _)
- local api = require("nvim-treesitter.configs")
- api.setup({
- ensure_installed = "all",
- sync_install = false,
- auto_install = true,
- highlight = {
- enable = true,
- additional_vim_regex_highlighting = false
- }
- })
- vim.opt.foldmethod = "expr"
- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
- end,
- build = function()
- require("nvim-treesitter.install").update({ with_sync = true })
- end
- }, {
- "nvim-treesitter/nvim-treesitter-context",
- enabled = true,
- lazy = false,
- dependencies = { "nvim-treesitter/nvim-treesitter" },
- config = function(_, _)
- require("treesitter-context").setup({
- enable = true,
- max_lines = 5,
- min_window_height = 0,
- line_numbers = true,
- multiline_threshold = 20,
- trim_scope = "outer",
- mode = "cursor",
- zindex = 20,
- on_attach = nil
- })
- vim.api.nvim_set_hl(0, "TreesitterContextSeparator",
- { link = "WinSeparator" })
- vim.keymap.set("n", "sc", function()
- require("treesitter-context").go_to_context(vim.v.count1)
- end, { silent = true })
- end
- }
- }
|