diff options
author | ngharo <root@ngha.ro> | 2023-12-29 17:46:10 -0600 |
---|---|---|
committer | ngharo <root@ngha.ro> | 2023-12-29 17:46:10 -0600 |
commit | 31474998d6935d48f678988c8a7a4fac7bb2ae72 (patch) | |
tree | c71114c23c31f888c0be1ec1b2efdab0d5ce6ca5 /after/plugin/nvim-cmp.lua | |
download | nvim-31474998d6935d48f678988c8a7a4fac7bb2ae72.tar.xz nvim-31474998d6935d48f678988c8a7a4fac7bb2ae72.zip |
Inititial commit
Diffstat (limited to 'after/plugin/nvim-cmp.lua')
-rw-r--r-- | after/plugin/nvim-cmp.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/after/plugin/nvim-cmp.lua b/after/plugin/nvim-cmp.lua new file mode 100644 index 0000000..6548b71 --- /dev/null +++ b/after/plugin/nvim-cmp.lua @@ -0,0 +1,21 @@ +local cmp = require('cmp') +-- using lsp-zero +local cmp_action = require('lsp-zero').cmp_action() + +cmp.setup({ + mapping = cmp.mapping.preset.insert({ + -- `Enter` key to confirm completion + ['<CR>'] = cmp.mapping.confirm({select = false}), + + -- Ctrl+Space to trigger completion menu + ['<C-Space>'] = cmp.mapping.complete(), + + -- Navigate between snippet placeholder + ['<C-f>'] = cmp_action.luasnip_jump_forward(), + ['<C-b>'] = cmp_action.luasnip_jump_backward(), + + -- Scroll up and down in the completion documentation + ['<C-u>'] = cmp.mapping.scroll_docs(-4), + ['<C-d>'] = cmp.mapping.scroll_docs(4), + }) +}) |