--[ -- It's treesitter, I should check how it works ! -- -- The goal of nvim-treesitter is both to provide a simple and easy way to use the interface for tree-sitter in Neovim and to provide some basic functionality such as highlighting based on it: -- -- -- Treesitter uses a different parser for every language, which needs to be generated via tree-sitter-cli from a grammar.js file, then compiled to a .so library that needs to be placed in neovim's runtimepath (typically under parser/{language}.so). To simplify this, nvim-treesitter provides commands to automate this process. If the language is already supported by nvim-treesitter, you can install it with :TSinstall --] return { "nvim-treesitter/nvim-treesitter", enabled = true, lazy = false, -- event = { "BufReadPre", "BufNewFile" }, build = ":TSUpdate", -- dependencies = { -- "windwp/nvim-ts-autotag", -- }, config = function() local treesitter = require("nvim-treesitter.configs") treesitter.setup({ modules = {}, ignore_install = { "" }, sync_install = false, highlight = { enable = true, additional_vim_regex_highlighting = false, }, indent = { enable = true, }, -- TODO: Install nvim-ts-autotag -- autotag = { -- With nvim-ts-autotag plugin -- enable = true, -- }, --[[ rainbow = { enable = true, extended_mode = true, max_file_lines = nil, }, --]] ensure_installed = { "rust", "go", "html", "python", "ocaml", "json", "javascript", "svelte", "typescript", "tsx", "yaml", "css", "lua", -- "mchat", -- { "mchat", "gsuuon/tree-sitter-mchat" }, "toml", }, auto_install = true, incremental_selection = { enable = true, keymaps = { init_selection = "", node_incremental = "", scope_incremental = false, node_decremental = "", }, }, }) -- require("nvim-ts-autotag").setup({ -- opts = { -- -- Defaults -- enable_close = true, -- Auto close tags -- enable_rename = true, -- Auto rename pairs of tags -- enable_close_on_slash = false, -- Auto close on trailing z", function() vim.cmd([[set foldexpr=nvim_treesitter#foldexpr()]]) end, { desc = "Refresh folding from Treesitter" }) end, }