Skip to content

Commit

Permalink
home-manager/neovim: make behavior consistent between nvim-cmp and pum
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Feb 27, 2024
1 parent 4cf7be9 commit 7a05e2e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions home-manager/editor/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ in
vim.keymap.set('n', '<C-g>', '<cmd>:noh<CR><CR>')
-- completion
vim.opt.completeopt = 'menu'
vim.opt.completeopt = 'menu,menuone,noinsert'
vim.keymap.set({'i', 'c'}, '<C-j>', function()
return vim.fn.pumvisible() ~= 0 and '<C-n>' or '<C-j>'
end, { expr = true })
Expand Down Expand Up @@ -512,15 +512,18 @@ in
config = /* lua */ ''
local cmp = require("cmp")
cmp.setup({
completion = { autocomplete = false },
completion = {
autocomplete = false,
completeopt = 'menu,menuone,noinsert'
},
mapping = {
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-k>'] = cmp.mapping.select_prev_item(),
['<C-j>'] = cmp.mapping.select_next_item(),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
snippet = {
expand = function(args)
Expand Down

0 comments on commit 7a05e2e

Please sign in to comment.