Add completion, cli on nvim session and others functions
This commit is contained in:
@@ -1,12 +1,19 @@
|
|||||||
{
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "a9d8fb72213c8b461e791409e7feabb74eb6ce73" },
|
||||||
"catppuccin": { "branch": "main", "commit": "12c004cde3f36cb1d57242f1e6aac46b09a0e5b4" },
|
"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" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" },
|
"nvim-lspconfig": { "branch": "master", "commit": "2163c54bb6cfec53e3e555665ada945b8c8331b9" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "4b30847c91d498446cb8440c03031359b045e050" },
|
"nvim-tree.lua": { "branch": "master", "commit": "4b30847c91d498446cb8440c03031359b045e050" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
|
"nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
|
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
|
||||||
}
|
}
|
||||||
|
|||||||
17
lua/plugins/alpha.lua
Normal file
17
lua/plugins/alpha.lua
Normal file
@@ -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
|
||||||
|
};
|
||||||
26
lua/plugins/completion.lua
Normal file
26
lua/plugins/completion.lua
Normal file
@@ -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({
|
||||||
|
['<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
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim-lsp' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = 'path' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
13
lua/plugins/persistence.lua
Normal file
13
lua/plugins/persistence.lua
Normal file
@@ -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
|
||||||
|
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||||
|
-- Charger la dernière session (même si on est ailleurs)
|
||||||
|
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
|
||||||
|
-- Ne pas sauvegarder la session actuelle
|
||||||
|
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
|
||||||
|
},
|
||||||
|
}
|
||||||
29
lua/plugins/terminal.lua
Normal file
29
lua/plugins/terminal.lua
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
return {
|
||||||
|
'akinsho/toggleterm.nvim',
|
||||||
|
version = "*",
|
||||||
|
config = function()
|
||||||
|
require("toggleterm").setup({
|
||||||
|
size = 20,
|
||||||
|
open_mapping = [[<c-\>]], -- 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', '<esc>', [[<C-\><C-n>]], opts) -- Esc pour sortir du mode insertion terminal
|
||||||
|
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user