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-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.
|
||||||
|
|
|
||||||
|
|
@ -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 = {}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
|
|
@ -20,12 +21,13 @@ 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()
|
||||||
treesitter.install({
|
treesitter.install({
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue