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
parent
3d690c9da1
commit
ccecc89a42
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
-- Install and configure Comment.nvim
|
||||
-- "gc" to comment visual regions/lines
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {}
|
||||
'nvim-mini/mini.comment'
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
-- Diagnostic keymaps
|
||||
|
||||
vim.keymap.set(
|
||||
|
|
@ -20,12 +21,13 @@ return {
|
|||
"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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue