mirror of
https://github.com/Cian-H/my_nvim_config.git
synced 2026-08-19 15:42:50 +01:00
Another attempt to fix tree-sitter
This commit is contained in:
+8
-13
@@ -72,8 +72,11 @@ return {
|
|||||||
{
|
{
|
||||||
"romus204/tree-sitter-manager.nvim",
|
"romus204/tree-sitter-manager.nvim",
|
||||||
dependencies = {},
|
dependencies = {},
|
||||||
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
require("tree-sitter-manager").setup({
|
local manager = require("tree-sitter-manager")
|
||||||
|
|
||||||
|
manager.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"c",
|
"c",
|
||||||
@@ -91,20 +94,12 @@ return {
|
|||||||
"vimdoc",
|
"vimdoc",
|
||||||
},
|
},
|
||||||
border = nil,
|
border = nil,
|
||||||
auto_install = false,
|
auto_install = true,
|
||||||
highlight = true,
|
highlight = true,
|
||||||
})
|
})
|
||||||
-- Automatically attach treesitter to buffers
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
local plugin_path = vim.fn.stdpath("data") .. "/lazy/tree-sitter-manager.nvim"
|
||||||
pattern = "*",
|
vim.opt.runtimepath:append(plugin_path)
|
||||||
callback = function()
|
|
||||||
local lang = vim.treesitter.language.get_lang(vim.bo.filetype)
|
|
||||||
if lang and vim.treesitter.query.get(lang, "highlights") then
|
|
||||||
pcall(vim.treesitter.start)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
group = vim.api.nvim_create_augroup("ts_native_highlight", { clear = true }),
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user