diff options
| author | Aleksa Vučković <aleksav013@gmail.com> | 2022-01-05 08:57:32 +0100 |
|---|---|---|
| committer | Aleksa Vučković <aleksav013@gmail.com> | 2022-01-05 08:57:32 +0100 |
| commit | 2a5f4d72d21d495408a52a2cad271b1e5775967b (patch) | |
| tree | c1bc1aa2844d32fd89e125db8285ceded2b4187d /lua/cmp.lua | |
| parent | 0eb2af20164f3281b9981386d7ac03713e2f3e01 (diff) | |
cmp_luasnip not working
Diffstat (limited to 'lua/cmp.lua')
| -rw-r--r-- | lua/cmp.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lua/cmp.lua b/lua/cmp.lua new file mode 100644 index 0000000..ec6695f --- /dev/null +++ b/lua/cmp.lua @@ -0,0 +1,35 @@ +local status, cmp = pcall(require, "cmp") +if not status then + return +end + +local status, luasnip = pcall(require, "luasnip") +if not status then + return +end + + +cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), + ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), + ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), + ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping. + ['<C-e>'] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }, + sources = { +-- { name = 'nvim_lsp' }, +-- { name = 'luasnip' }, +-- { name = 'buffer' }, +-- { name = "path" }, + }, +}) |
