Update treesitter to main

This commit is contained in:
Dreaded_X 2025-05-26 02:48:43 +02:00
parent 98d9158287
commit 0d3d49ddf4
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA
5 changed files with 38 additions and 24 deletions

View File

@ -4,6 +4,8 @@
[includeIf "gitdir:~/Projects/ALTEN/"] [includeIf "gitdir:~/Projects/ALTEN/"]
path = ~/.dotfiles/git/profiles/ALTEN path = ~/.dotfiles/git/profiles/ALTEN
[includeIf "gitdir:~/Projects/vlasman/"]
path = ~/.dotfiles/git/profiles/ALTEN
[filter "lfs"] [filter "lfs"]
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true

View File

@ -35,9 +35,9 @@
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lspconfig": { "branch": "master", "commit": "3ea99227e316c5028f57a4d86a1a7fd01dd876d0" }, "nvim-lspconfig": { "branch": "master", "commit": "3ea99227e316c5028f57a4d86a1a7fd01dd876d0" },
"nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "main", "commit": "c1dfc39285e4a11983dfbe556fb0be7f2a749977" },
"nvim-treesitter-context": { "branch": "master", "commit": "938003c79d23912d2cafd56d939346860f78127a" }, "nvim-treesitter-context": { "branch": "master", "commit": "404502e607c3b309e405be9112c438c721153372" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "fa32a45fdbab9c9c3bda9ecec9b12dddb221b927" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },

View File

@ -32,3 +32,15 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
group = cursor_group, group = cursor_group,
pattern = "*", pattern = "*",
}) })
vim.api.nvim_create_autocmd("FileType", {
pattern = require("tools.highlight"),
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})

View File

@ -4,27 +4,15 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",
"nvim-treesitter/nvim-treesitter-textobjects", { "nvim-treesitter/nvim-treesitter-textobjects", branch = "main" },
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
}, },
lazy = false,
branch = "main",
build = ":TSUpdate",
opts = { opts = {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { ensure_installed = require("tools.highlight"),
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
},
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = true, auto_install = true,
@ -91,10 +79,6 @@ return {
enable = true, enable = true,
}, },
}, },
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
require("nvim-treesitter.install").update({ with_sync = true })
end,
}, },
{ {
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",

View File

@ -0,0 +1,16 @@
return {
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
}