1
0
Fork 0

nvim: Update cmp configuration

This commit is contained in:
Daniel Kempkens 2022-04-15 01:21:13 +02:00
parent 2f6f72944d
commit 2523e05dcc

View file

@ -27,21 +27,21 @@
[{:name :treesitter} [{:name :treesitter}
{:name :buffer} {:name :buffer}
{:name :path}]) {:name :path}])
:mapping {:<C-e> (cmp.mapping {:i (cmp.mapping.abort) :mapping (cmp.mapping.preset.insert {:<C-e> (cmp.mapping {:i (cmp.mapping.abort)
:c (cmp.mapping.close)}) :c (cmp.mapping.close)})
:<Tab> (cmp.mapping {:c #(if (cmp.visible) :<Tab> (cmp.mapping {:c #(if (cmp.visible)
(cmp.select_next_item {:behavior cmp.SelectBehavior.Insert}) (cmp.select_next_item {:behavior cmp.SelectBehavior.Insert})
(cmp.complete)) (cmp.complete))
:i map-tab :i map-tab
:s map-tab}) :s map-tab})
:<S-Tab> (cmp.mapping {:c #(if (cmp.visible) :<S-Tab> (cmp.mapping {:c #(if (cmp.visible)
(cmp.select_prev_item {:behavior cmp.SelectBehavior.Insert}) (cmp.select_prev_item {:behavior cmp.SelectBehavior.Insert})
(cmp.complete)) (cmp.complete))
:i map-stab :i map-stab
:s map-stab}) :s map-stab})
:<C-Space> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert :<C-Space> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert
:select true}) :select true})
:<CR> (cmp.mapping.confirm {:select true})} :<CR> (cmp.mapping.confirm {:select true})})
:completion {:keyword_length 2 :completion {:keyword_length 2
:completeopt "menu,menuone,noinsert"} :completeopt "menu,menuone,noinsert"}
:window {:documentation {:border ["╭" :window {:documentation {:border ["╭"
@ -52,12 +52,15 @@
"─" "─"
"╰" "╰"
"│"]}} "│"]}}
:snippet {:expand #(snippy.expand_snippet $1.body)} :snippet {:expand (fn [args]
(snippy.expand_snippet args.body))}
:formatting {:format (lspkind.cmp_format)}}) :formatting {:format (lspkind.cmp_format)}})
(cmp.setup.cmdline "/" (cmp.setup.cmdline "/"
{:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}] {:sources (cmp.config.sources [{:name :nvim_lsp_document_symbol}]
[{:name :buffer}])}) [{:name :buffer}])
:mapping (cmp.mapping.preset.cmdline)})
(cmp.setup.cmdline ":" (cmp.setup.cmdline ":"
{:sources (cmp.config.sources [{:name :path}] {:sources (cmp.config.sources [{:name :path}]
[{:name :cmdline}])}) [{:name :cmdline}])
:mapping (cmp.mapping.preset.cmdline)})
(cmp.event:on :confirm_done (npairs.on_confirm_done {:map_char {:tex ""}}))) (cmp.event:on :confirm_done (npairs.on_confirm_done {:map_char {:tex ""}})))