update nvim-treesitter to main

This commit is contained in:
Alexander Navarro 2025-09-04 10:46:28 -04:00
parent 41f458954a
commit 7e24245690
3 changed files with 60 additions and 49 deletions

View file

@ -20,10 +20,10 @@
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
"nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" },
"nvim-treesitter": { "branch": "master", "commit": "8d4fdc5e47e2a4e00179e43f56221250ce365973" },
"nvim-treesitter-context": { "branch": "master", "commit": "6b081ea63a3711243d11540ce28ccdb6f35ecd33" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" },
"nvim-treesitter": { "branch": "main", "commit": "802195d8f1980db25a7a39a55f9a25df21756c73" },
"nvim-treesitter-context": { "branch": "master", "commit": "66a9b5fa9e806918b5fe3dba00c6cce7e230abd2" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"render-markdown": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" },

View file

@ -163,6 +163,7 @@ vim.lsp.enable({
"bashls",
"biome",
"fish_lsp",
"gleam",
"hyprls",
"intelephense",
"jsonls",

View file

@ -2,7 +2,7 @@ return {
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
branch = "master",
branch = "main",
dependencies = {
{
"JoosepAlviste/nvim-ts-context-commentstring",
@ -18,33 +18,43 @@ return {
highlight = { enable = true },
indent = { enable = true },
},
init = function()
-- HACK: for filetypes that doesn't start treesitter hightlight on it's own
vim.api.nvim_create_autocmd("FileType", {
pattern = { "gleam" },
callback = function()
vim.treesitter.start()
end,
})
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
dependencies = { "nvim-treesitter", },
dependencies = { "nvim-treesitter" },
branch = "main",
config = function()
require 'nvim-treesitter.configs'.setup({
textobjects = {
local ts_obj = require("nvim-treesitter-textobjects")
ts_obj.setup({
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next = {
["]]"] = { query = { "@block.outer", "@function.outer", "@class.outer", } },
},
goto_previous = {
["[["] = { query = { "@block.outer", "@function.outer", "@class.outer", } },
}
},
set_jumps = true,
},
})
local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
vim.keymap.set({ "n", "x", "o" }, "]]", function()
ts_obj.move.goto_next({ "@block.outer", "@function.outer", "@class.outer" }, "textobjects")
end)
vim.keymap.set({ "n", "x", "o" }, "[[", function()
ts_obj.move.goto_previous({ "@block.outer", "@function.outer", "@class.outer" }, "textobjects")
end)
local ts_repeat_move = require("nvim-treesitter-textobjects.repeatable_move")
-- Repeat movement with ; and ,
-- ensure ; goes forward and , goes backward regardless of the last direction
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_previous)
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_next)
end
}
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_opposite)
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move)
end,
},
}