aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/autocomplete.lua
diff options
context:
space:
mode:
authorAlec Goncharow <alec@goncharow.dev>2025-04-20 15:46:33 -0400
committerAlec Goncharow <alec@goncharow.dev>2025-04-20 15:48:01 -0400
commit973673083f215451b7674a22533b4e7dfdfb81fd (patch)
treebe7942cc9e98755edeb24427e4776b75e7485f73 /.config/nvim/lua/autocomplete.lua
parent78efc3eb493b40ad2f79408a47bb873b5eea9db0 (diff)
maybe useful
idk
Diffstat (limited to '.config/nvim/lua/autocomplete.lua')
-rw-r--r--.config/nvim/lua/autocomplete.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/.config/nvim/lua/autocomplete.lua b/.config/nvim/lua/autocomplete.lua
index 4ada86b..1de4271 100644
--- a/.config/nvim/lua/autocomplete.lua
+++ b/.config/nvim/lua/autocomplete.lua
@@ -23,7 +23,7 @@ cmp.setup({
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<C-y>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
+ ['<C-y>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<C-e>'] = cmp.mapping.abort(),
}),
sources = cmp.config.sources({
@@ -35,9 +35,14 @@ cmp.setup({
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
- })
+ }),
+ completion = {
+ autocomplete = false
+ }
})
+vim.keymap.set('i', '<C-c>', cmp.mapping.complete(), {})
+
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
@@ -57,9 +62,9 @@ cmp.setup.cmdline({ '/', '?' }, {
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
- { name = 'path' }
- }, {
{ name = 'cmdline' }
+ }, {
+ { name = 'path' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})