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-surround` to improve surroundings management.
- `autopairs.nvim`.
- `Comment.nvim` to comment lines and blocs.
- `mini.comment` to comment lines and blocs.
- `ident-blankline.nvim` to improve readability of indentation.
- `zen-mode.nvim` for a good zen mode.
- `toggleterm.nvim` to quickly get a terminal. Might find a better one.

View File

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

View File

@ -1,3 +1,4 @@
-- Diagnostic keymaps
vim.keymap.set(
@ -17,15 +18,16 @@ vim.keymap.set(
-- Install and configure treesitter
return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
branch = "main", -- ← nécessaire aussi pour textobjects
},
lazy = false,
branch = "main",
build = ":TSUpdate",
-- Configure treesitter
config = function ()
config = function()
local treesitter = require('nvim-treesitter')
treesitter.setup()
treesitter.install({
@ -74,14 +76,14 @@ return {
},
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
pcall(vim.treesitter.start) -- ← pcall: évite l'erreur si pas de parser
-- folds, provided by Neovim
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
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()"
end,
})
end
}