Add multiple plugin
This commit is contained in:
7
lua/plugins/comment.lua
Normal file
7
lua/plugins/comment.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {}, -- Utilise la config par défaut
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
@@ -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({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Entrée pour valider
|
||||
['<Tab>'] = cmp.mapping.select_next_item(), -- Tab pour descendre
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
-- Navigation intelligente dans le snippet avec Tab
|
||||
['<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' },
|
||||
})
|
||||
|
||||
6
lua/plugins/friendly-snippets.lua
Normal file
6
lua/plugins/friendly-snippets.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end
|
||||
}
|
||||
10
lua/plugins/gitsigns.lua
Normal file
10
lua/plugins/gitsigns.lua
Normal file
@@ -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', '<leader>gp', ':Gitsigns preview_hunk<CR>')
|
||||
end
|
||||
}
|
||||
5
lua/plugins/indent.lua
Normal file
5
lua/plugins/indent.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {},
|
||||
}
|
||||
@@ -19,7 +19,9 @@ return {
|
||||
|
||||
-- Configuration pour Bash
|
||||
vim.lsp.config('bashls', {})
|
||||
|
||||
-- Dans la fonction config de lspconfig
|
||||
vim.keymap.set('n', '<C-k>', 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
|
||||
|
||||
14
lua/plugins/noice.lua
Normal file
14
lua/plugins/noice.lua
Normal file
@@ -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 },
|
||||
},
|
||||
}
|
||||
6
lua/plugins/surround.lua
Normal file
6
lua/plugins/surround.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
opts = {}
|
||||
}
|
||||
8
lua/plugins/todo.lua
Normal file
8
lua/plugins/todo.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Search TODOs" },
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user