1
0
mirror of https://codeberg.org/diginaut/dotfiles.git synced 2026-02-04 06:40:25 +01:00

Treesitter has changed their API

This commit is contained in:
2026-01-21 11:44:10 +01:00
parent 292c44448f
commit 105d3273fb

View File

@@ -1,23 +1,57 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
lazy = false, lazy = false, -- Keep false to ensure loading for Neo-tree
build = ":TSUpdate", build = ":TSUpdate",
config = function() config = function()
require("nvim-treesitter.configs").setup({ local treesitter = require("nvim-treesitter")
ensure_installed = { treesitter.setup()
treesitter.install({
"java",
"c",
"lua",
"vim",
"vimdoc",
"query",
-- "elixir",
-- "heex",
"markdown",
"markdown_inline",
"bash",
"javascript",
"typescript",
"html",
"toml",
"yaml",
})
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"java",
"c", "c",
"lua", "lua",
"vim", "vim",
"vimdoc", "vimdoc",
"query", "query",
-- "elixir",
-- "heex",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"bash", "bash",
"javascript", "javascript",
"typescript",
"html",
"toml", "toml",
"yaml",
}, },
auto_install = false, callback = function()
-- ... -- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim (I don't like folds)
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- vim.wo.foldmethod = 'expr'
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
}) })
end, end,
} }