Skip to content

Commit

Permalink
feat(nvim-cmp): update nvim-cmp config
Browse files Browse the repository at this point in the history
Signed-off-by: Chris1320 <chris1320is@protonmail.com>
  • Loading branch information
Chris1320 committed Dec 13, 2024
1 parent d2dcc4b commit 804b9ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require("lazy").setup({
{ import = "lazyvim.plugins.extras.ai.copilot-chat" },
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
{ import = "lazyvim.plugins.extras.coding.neogen" },
{ import = "lazyvim.plugins.extras.coding.nvim-cmp" },

{ import = "lazyvim.plugins.extras.editor.illuminate" },
{ import = "lazyvim.plugins.extras.editor.inc-rename" },
Expand All @@ -30,6 +31,7 @@ require("lazy").setup({

{ import = "lazyvim.plugins.extras.util.dot" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
{ import = "lazyvim.plugins.extras.util.octo" },
{ import = "lazyvim.plugins.extras.util.rest" },
{ import = "lazyvim.plugins.extras.util.startuptime" },

Expand Down
8 changes: 4 additions & 4 deletions src/lua/plugins/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-cmdline",
{
"petertriho/cmp-git",
dependencies = "nvim-lua/plenary.nvim",
},
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
Expand Down Expand Up @@ -105,6 +101,7 @@ return {
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = lazyvim_cmp.confirm({ select = false }),
["<C-y>"] = lazyvim_cmp.confirm({ select = true }),
["<S-CR>"] = lazyvim_cmp.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
Expand All @@ -113,6 +110,9 @@ return {
cmp.abort()
fallback()
end,
["<tab>"] = function(fallback)
return lazyvim_cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
end,
})

-- Show suggestions from buffer when searching and entering commands.
Expand Down

0 comments on commit 804b9ed

Please sign in to comment.