nvim-config/fnl/setup-cmp.fnl

23 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-07-29 15:21:07 +00:00
(let [cmp (require :cmp)
luasnip (require :luasnip)
vscode-snips (require :luasnip.loaders.from_vscode)
{: cmp-mapping} (require :personalize)]
(vscode-snips.lazy_load)
(luasnip.config.setup)
(cmp.setup {:snippet {:expand #(luasnip $1)}
:mapping (cmp.mapping.preset.insert cmp-mapping)
:sources (cmp.config.sources [{:name :nvim_lsp}
{:name :luasnip}
{:name :buffer}])})
(cmp.setup.cmdline ["/" "?"]
{:mapping (cmp.mapping.preset.cmdline)
:sources [{:name :buffer}]})
(cmp.setup.cmdline [":"]
{:mapping (cmp.mapping.preset.cmdline)
:sources (cmp.config.sources [{:name :path}
{:name :cmdline}])})
(cmp.setup.filetype [:gitcommit]
{:mapping (cmp.mapping.preset.cmdline)
:sources (cmp.config.sources [{:name :git}
{:name :buffer}])}))