astro-nvim-v3 - Update: add context function for neo

This commit is contained in:
huyjaky
2025-08-02 13:03:28 +07:00
parent f0c5a8f756
commit e9e1ab82b3
11 changed files with 360 additions and 331 deletions

View File

@@ -0,0 +1,28 @@
---@type LazySpec
return {
"nvim-treesitter/nvim-treesitter-context",
event = "User AstroFile",
cmd = { "TSContext" },
opts = {
-- không có option trực tiếp cho border, nên ta set highlight ở đây
on_attach = function()
vim.api.nvim_set_hl(0, "TreesitterContext", { underline = true, sp = "Red", bg = "#1e1e3f" })
end,
max_lines = 2, -- 0 means no limit
},
dependencies = {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
["<Leader>uT"] = {
"<cmd>TSContext toggle<CR>",
desc = "Toggle treesitter context",
},
},
},
},
},
}