Add completion, cli on nvim session and others functions
This commit is contained in:
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
|
||||
}
|
||||
Reference in New Issue
Block a user