diff options
author | Yigit Sever | 2024-10-10 10:04:46 +0200 |
---|---|---|
committer | Yigit Sever | 2024-10-10 10:04:46 +0200 |
commit | 9746cb182f59b43e3d17ec044d1afd8ffb5b07da (patch) | |
tree | e261c6e0ce7a2f15f44d5a5aebc45fc14d2b0a95 /.config/nvim/lua/plugins/cmp.lua | |
parent | b86bb46e1ac60bc97882dba1a7c2bb153f1cdb9d (diff) | |
download | dotfiles-9746cb182f59b43e3d17ec044d1afd8ffb5b07da.tar.gz dotfiles-9746cb182f59b43e3d17ec044d1afd8ffb5b07da.tar.bz2 dotfiles-9746cb182f59b43e3d17ec044d1afd8ffb5b07da.zip |
nvim: usable cmp mappings
Diffstat (limited to '.config/nvim/lua/plugins/cmp.lua')
-rw-r--r-- | .config/nvim/lua/plugins/cmp.lua | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 8e34264..097d413 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua | |||
@@ -73,25 +73,19 @@ return { | |||
73 | end, | 73 | end, |
74 | }, | 74 | }, |
75 | mapping = cmp.mapping.preset.insert({ | 75 | mapping = cmp.mapping.preset.insert({ |
76 | ["<C-f>"] = cmp.mapping.scroll_docs(-4), | 76 | ["<C-l>"] = cmp.mapping.confirm({ |
77 | ["<C-d>"] = cmp.mapping.scroll_docs(4), | ||
78 | ["<CR>"] = cmp.mapping.confirm({ | ||
79 | behavior = cmp.ConfirmBehavior.Replace, | 77 | behavior = cmp.ConfirmBehavior.Replace, |
80 | select = false, | 78 | select = true, |
81 | }), | 79 | }), |
82 | ["<Tab>"] = cmp.mapping(function(fallback) | 80 | ["<Tab>"] = cmp.mapping(function(fallback) |
83 | if cmp.visible() then | 81 | if luasnip.locally_jumpable(1) then |
84 | cmp.select_next_item() | 82 | luasnip.jump(1) |
85 | elseif luasnip.expand_or_jumpable() then | ||
86 | luasnip.expand_or_jump() | ||
87 | else | 83 | else |
88 | fallback() | 84 | fallback() |
89 | end | 85 | end |
90 | end, { "i", "s" }), | 86 | end, { "i", "s" }), |
91 | ["<S-Tab>"] = cmp.mapping(function(fallback) | 87 | ["<S-Tab>"] = cmp.mapping(function(fallback) |
92 | if cmp.visible() then | 88 | if luasnip.locally_jumpable(-1) then |
93 | cmp.select_prev_item() | ||
94 | elseif luasnip.jumpable(-1) then | ||
95 | luasnip.jump(-1) | 89 | luasnip.jump(-1) |
96 | else | 90 | else |
97 | fallback() | 91 | fallback() |