setup key bindings for cmp

This commit is contained in:
Adithya 2024-02-11 22:46:18 +05:30
parent 690282a5a0
commit f9be2d3a85
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -2,6 +2,13 @@ require("cmp_git").setup()
local cmp = require("cmp") local cmp = require("cmp")
cmp.setup({ cmp.setup({
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-space>"] = cmp.mapping.complete(),
["<C-q>"] = cmp.mapping.close(),
["<Tab>"] = cmp.mapping.confirm({ select = true }),
},
snippet = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)