plugins: update treesitter, replace comment.nvim

- Updates nvim-treesitter since the neovim 0.12 version, as it is
  archived.
- Replaces comment.nvim by mini.comment.

Co-Authored-by: iGor milhit <igor@milhit.ch>
main
iGor milhit 2026-06-12 14:57:29 +02:00
parent 3d690c9da1
commit ccecc89a42
Signed by: igor
GPG Key ID: 692D97C3D0228A99
3 changed files with 13 additions and 12 deletions

View File

@ -93,7 +93,7 @@ I don't provide links for each of these plugins as they are easy to be found.
- `vim-speeddating` to increment dates, times, etc. - `vim-speeddating` to increment dates, times, etc.
- `vim-surround` to improve surroundings management. - `vim-surround` to improve surroundings management.
- `autopairs.nvim`. - `autopairs.nvim`.
- `Comment.nvim` to comment lines and blocs. - `mini.comment` to comment lines and blocs.
- `ident-blankline.nvim` to improve readability of indentation. - `ident-blankline.nvim` to improve readability of indentation.
- `zen-mode.nvim` for a good zen mode. - `zen-mode.nvim` for a good zen mode.
- `toggleterm.nvim` to quickly get a terminal. Might find a better one. - `toggleterm.nvim` to quickly get a terminal. Might find a better one.

View File

@ -1,6 +1,5 @@
-- Install and configure Comment.nvim -- Install and configure Comment.nvim
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
return { return {
'numToStr/Comment.nvim', 'nvim-mini/mini.comment'
opts = {}
} }

View File

@ -1,3 +1,4 @@
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set( vim.keymap.set(
@ -20,11 +21,12 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
branch = "main", -- ← nécessaire aussi pour textobjects
}, },
lazy = false, lazy = false,
branch = "main",
build = ":TSUpdate", build = ":TSUpdate",
-- Configure treesitter
config = function() config = function()
local treesitter = require('nvim-treesitter') local treesitter = require('nvim-treesitter')
treesitter.setup() treesitter.setup()
@ -74,14 +76,14 @@ return {
}, },
callback = function() callback = function()
-- syntax highlighting, provided by Neovim -- syntax highlighting, provided by Neovim
vim.treesitter.start() pcall(vim.treesitter.start) -- ← pcall: évite l'erreur si pas de parser
-- folds, provided by Neovim -- folds, provided by Neovim
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = 'expr' vim.wo.foldmethod = 'expr'
-- indentation, provided by nvim-treesitter -- indentation, provided by nvim-treesitter (expérimental)
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end, end,
}) })
end end
} }