summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-11 19:57:06 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-11 19:57:06 +0200
commit8a7e434c101c3d075dcf979e1aafea1a3d65470d (patch)
tree386990c1bfa0cfb59f7be6aabeb5f72de2483098
parent420b7ff3373c4b60f47617d91b06022ae65107b9 (diff)
feat(cmp): add more mappings
-rw-r--r--fnl/config/cmp.fnl12
1 files changed, 11 insertions, 1 deletions
diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl
index e4e16da..082303c 100644
--- a/fnl/config/cmp.fnl
+++ b/fnl/config/cmp.fnl
@@ -9,7 +9,15 @@
(cmp.setup {:snippet {:expand (fn [args]
(luasnip.lsp_expand args.body))}
:mapping {:<C-k> (cmp.mapping.select_prev_item)
- :<C-j> (cmp.mapping.select_next_item)}
+ :<C-j> (cmp.mapping.select_next_item)
+ :<C-b> (cmp.mapping (cmp.mapping.scroll_docs -1)
+ [:i :c])
+ :<C-f> (cmp.mapping (cmp.mapping.scroll_docs 1) [:i :c])
+ :<C-space> (cmp.mapping (cmp.mapping.complete) [:i :c])
+ :<C-e> (cmp.mapping {:i (cmp.mapping.abort)
+ :c (cmp.mapping.close)})
+ :<CR> (cmp.mapping.confirm {:select true})
+ :<CR> (cmp.mapping.confirm {:select true})}
:sources [{:name :nvim_lsp}
{:name :nvim_lua}
{:name :luasnip}
@@ -29,4 +37,6 @@
"─"
"╰"
"│"]}
+ :confirm_opts {:behavior (cmp.ConfirmBehavior.Replace)
+ :select false}
:experimental {:ghost_text false :native_menu false}}))