diff --git a/README.md b/README.md index 7748dff..9b557ad 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lua/plugins/comment.lua b/lua/plugins/mini.comment.lua similarity index 69% rename from lua/plugins/comment.lua rename to lua/plugins/mini.comment.lua index ce9eacc..4106109 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/mini.comment.lua @@ -1,6 +1,5 @@ -- Install and configure Comment.nvim -- "gc" to comment visual regions/lines return { - 'numToStr/Comment.nvim', - opts = {} + 'nvim-mini/mini.comment' } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 14894ef..052e3ed 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -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 } +