summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-01-15 09:26:27 +0000
committerAkshay <[email protected]>2022-01-15 09:26:27 +0000
commit4ff231c3a55d2b49cd72d824d45480b6b7961190 (patch)
tree05ca13dea4535ec683b01cc47fc70ef5e19d9e63 /lua
parent458ec6367670a847cc7a48f8ab32299b22509417 (diff)
switch to nvim-cmp
Diffstat (limited to 'lua')
-rw-r--r--lua/completions.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/lua/completions.lua b/lua/completions.lua
new file mode 100644
index 0000000..f7598a6
--- /dev/null
+++ b/lua/completions.lua
@@ -0,0 +1,37 @@
1local cmp = require 'cmp'
2
3cmp.setup({
4 snippet = {
5 expand = function(args) end,
6 },
7 mapping = {
8 ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
9 ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
10 ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
11 ['<C-y>'] = cmp.config.disable,
12 ['<C-e>'] = cmp.mapping({
13 i = cmp.mapping.abort(),
14 c = cmp.mapping.close(),
15 }),
16 ['<CR>'] = cmp.mapping.confirm({ select = true }),
17 },
18 sources = cmp.config.sources({
19 { name = 'nvim_lsp' },
20 }, {
21 { name = 'buffer' },
22 })
23})
24
25cmp.setup.cmdline('/', {
26 sources = {
27 { name = 'buffer' }
28 }
29})
30
31cmp.setup.cmdline(':', {
32 sources = cmp.config.sources({
33 { name = 'path' }
34 }, {
35 { name = 'cmdline' }
36 })
37})