diff --git a/lazy-lock.json b/lazy-lock.json index 785b792..16bb1ae 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,12 +1,19 @@ { + "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" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, "nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" }, "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" } } diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..1190cd9 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,17 @@ +return { + 'goolord/alpha-nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function () + local dashboard = require'alpha.themes.startify' + -- Tu peux personnaliser le header ici avec un ASCII art de ton choix + dashboard.section.header.val = { + [[ __ ]], + [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], + [[ /' _ `\ /'__`\ / __`\/\ \/\ \\/\ \ /' __` __`\ ]], + [[ /\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \ /\ \/\ \/\ \ ]], + [[ \ \_\ \_\ \____\ \____/\ \___/ \ \_\\ \_\ \_\ \_\]], + [[ \/_/\/_/\/____/\/___/ \/__/ \/_/ \/_/\/_/\/_/]], + } + require'alpha'.setup(dashboard.config) + end +}; diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua new file mode 100644 index 0000000..0833a7a --- /dev/null +++ b/lua/plugins/completion.lua @@ -0,0 +1,26 @@ +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 + }, + config = function() + local cmp = require("cmp") + cmp.setup({ + 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 + }), + sources = cmp.config.sources({ + { name = 'nvim-lsp' }, + { name = 'buffer' }, + { name = 'path' }, + }) + }) + end +} diff --git a/lua/plugins/persistence.lua b/lua/plugins/persistence.lua new file mode 100644 index 0000000..b24789c --- /dev/null +++ b/lua/plugins/persistence.lua @@ -0,0 +1,13 @@ +return { + "folke/persistence.nvim", + event = "BufReadPre", -- Charge le plugin au besoin + opts = { options = { "buffers", "curdir", "tabpages", "winsize" } }, + keys = { + -- Charger la session du répertoire actuel + { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + -- Charger la dernière session (même si on est ailleurs) + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + -- Ne pas sauvegarder la session actuelle + { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + }, +} diff --git a/lua/plugins/terminal.lua b/lua/plugins/terminal.lua new file mode 100644 index 0000000..6f8256c --- /dev/null +++ b/lua/plugins/terminal.lua @@ -0,0 +1,29 @@ +return { + 'akinsho/toggleterm.nvim', + version = "*", + config = function() + require("toggleterm").setup({ + size = 20, + open_mapping = [[]], -- Ctrl + \ pour ouvrir/fermer + hide_numbers = true, + shade_terminals = true, + direction = 'float', -- 'vertical', 'horizontal' ou 'float' + float_opts = { + border = 'curved', + winblend = 3, + }, + }) + + -- Raccourcis pratiques une fois DANS le terminal + function _G.set_terminal_keymaps() + local opts = {buffer = 0} + vim.keymap.set('t', '', [[]], opts) -- Esc pour sortir du mode insertion terminal + vim.keymap.set('t', '', [[wincmd h]], opts) + vim.keymap.set('t', '', [[wincmd j]], opts) + vim.keymap.set('t', '', [[wincmd k]], opts) + vim.keymap.set('t', '', [[wincmd l]], opts) + end + + vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') + end +}