From 0451c85dfa927b319dcd6413a44f412564d8b974f75ccec063b5a0f93cb5ee2a Mon Sep 17 00:00:00 2001 From: Maxime TEYSSIER Date: Sun, 8 Mar 2026 19:26:33 +0100 Subject: [PATCH] Add multiple plugin --- lazy-lock.json | 13 ++++++++++- lua/plugins/comment.lua | 7 ++++++ lua/plugins/completion.lua | 39 ++++++++++++++++++++++++------- lua/plugins/friendly-snippets.lua | 6 +++++ lua/plugins/gitsigns.lua | 10 ++++++++ lua/plugins/indent.lua | 5 ++++ lua/plugins/lsp.lua | 4 +++- lua/plugins/noice.lua | 14 +++++++++++ lua/plugins/surround.lua | 6 +++++ lua/plugins/todo.lua | 8 +++++++ 10 files changed, 101 insertions(+), 11 deletions(-) create mode 100644 lua/plugins/comment.lua create mode 100644 lua/plugins/friendly-snippets.lua create mode 100644 lua/plugins/gitsigns.lua create mode 100644 lua/plugins/indent.lua create mode 100644 lua/plugins/noice.lua create mode 100644 lua/plugins/surround.lua create mode 100644 lua/plugins/todo.lua diff --git a/lazy-lock.json b/lazy-lock.json index 16bb1ae..9791b45 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,19 +1,30 @@ { + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, "alpha-nvim": { "branch": "main", "commit": "a9d8fb72213c8b461e791409e7feabb74eb6ce73" }, "catppuccin": { "branch": "main", "commit": "12c004cde3f36cb1d57242f1e6aac46b09a0e5b4" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, "nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-surround": { "branch": "main", "commit": "61319d4bd1c5e336e197defa15bd104c51f0fb29" }, "nvim-tree.lua": { "branch": "master", "commit": "4b30847c91d498446cb8440c03031359b045e050" }, "nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" }, "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" } + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" } } diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..4ebd637 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,7 @@ +return { + 'numToStr/Comment.nvim', + opts = {}, -- Utilise la config par défaut + config = function() + require('Comment').setup() + end +} diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index 0833a7a..ffbbbde 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -1,23 +1,44 @@ return { "hrsh7th/nvim-cmp", dependencies = { - "hrsh7th/cmp-nvim-lsp", -- Source LSP - "hrsh7th/cmp-buffer", -- Source mots du buffer actuel - "hrsh7th/cmp-path", -- Source chemins de fichiers - "L3MON4D3/LuaSnip", -- Moteur de snippets + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", -- LE PONT : permet à nvim-cmp de voir les snippets + "rafamadriz/friendly-snippets", -- LA BIBLIOTHÈQUE }, config = function() local cmp = require("cmp") + local luasnip = require("luasnip") + + -- CHARGEMENT : C'est cette ligne qui active friendly-snippets + require("luasnip.loaders.from_vscode").lazy_load() + cmp.setup({ + snippet = { + -- OBLIGATOIRE : Dit à nvim-cmp comment étendre le snippet + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm({ select = true }), -- Entrée pour valider - [''] = cmp.mapping.select_next_item(), -- Tab pour descendre + [''] = cmp.mapping.confirm({ select = true }), + -- Navigation intelligente dans le snippet avec Tab + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), }), sources = cmp.config.sources({ - { name = 'nvim-lsp' }, + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- On ajoute la source snippet ici { name = 'buffer' }, { name = 'path' }, }) diff --git a/lua/plugins/friendly-snippets.lua b/lua/plugins/friendly-snippets.lua new file mode 100644 index 0000000..1af7e81 --- /dev/null +++ b/lua/plugins/friendly-snippets.lua @@ -0,0 +1,6 @@ +return { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..4982db8 --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,10 @@ +return { + "lewis6991/gitsigns.nvim", + config = function() + require('gitsigns').setup({ + current_line_blame = true, -- Affiche qui a écrit la ligne (Git Blame) en gris clair + }) + -- Raccourci pour voir la modif en détail (diff) + vim.keymap.set('n', 'gp', ':Gitsigns preview_hunk') + end +} diff --git a/lua/plugins/indent.lua b/lua/plugins/indent.lua new file mode 100644 index 0000000..95f859e --- /dev/null +++ b/lua/plugins/indent.lua @@ -0,0 +1,5 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = {}, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index e820c92..0eface0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -19,7 +19,9 @@ return { -- Configuration pour Bash vim.lsp.config('bashls', {}) - + -- Dans la fonction config de lspconfig + vim.keymap.set('n', '', vim.lsp.buf.signature_help, { desc = "Signature help" }) + -- Note : Si tu veux ajouter des options spécifiques plus tard, -- c'est dans le deuxième argument {} qu'on les met. end diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..7953f55 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,14 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, + opts = { + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + }, + }, + presets = { bottom_search = true, command_palette = true, long_message_to_split = true }, + }, +} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua new file mode 100644 index 0000000..84257cd --- /dev/null +++ b/lua/plugins/surround.lua @@ -0,0 +1,6 @@ +return { + "kylechui/nvim-surround", + version = "*", + event = "VeryLazy", + opts = {} +} diff --git a/lua/plugins/todo.lua b/lua/plugins/todo.lua new file mode 100644 index 0000000..f8b36b5 --- /dev/null +++ b/lua/plugins/todo.lua @@ -0,0 +1,8 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + keys = { + { "st", "TodoTelescope", desc = "Search TODOs" }, + }, +}