mirror of
https://gitea.zaclys.com/yannic/dotfiles.git
synced 2026-11-10 20:35:13 +01:00
Compatibility v0.11 / v0.12
This commit is contained in:
@@ -62,13 +62,29 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
branch = "master", -- la branche main exige nvim >= 0.11
|
-- master : nvim 0.10/0.11 (figé) ; main : nvim >= 0.12 (réécriture incompatible)
|
||||||
|
branch = vim.fn.has("nvim-0.12") == 1 and "main" or "master",
|
||||||
|
lazy = false,
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
main = "nvim-treesitter.configs",
|
config = function()
|
||||||
opts = {
|
local langs = { "markdown", "markdown_inline", "html", "yaml", "lua", "vim", "vimdoc" }
|
||||||
ensure_installed = { "markdown", "markdown_inline", "html", "yaml", "lua", "vim", "vimdoc" },
|
if vim.fn.has("nvim-0.12") == 1 then
|
||||||
|
if vim.fn.executable("tree-sitter") == 1 then
|
||||||
|
require("nvim-treesitter").install(langs)
|
||||||
|
else
|
||||||
|
vim.notify("nvim-treesitter : CLI `tree-sitter` absente, parsers non installés", vim.log.levels.WARN)
|
||||||
|
end
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "markdown", "html", "yaml", "lua", "vim", "help" },
|
||||||
|
callback = function() pcall(vim.treesitter.start) end,
|
||||||
|
})
|
||||||
|
else
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
ensure_installed = langs,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
},
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{ "echasnovski/mini.icons", lazy = true, opts = {} },
|
{ "echasnovski/mini.icons", lazy = true, opts = {} },
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user