nvim-config/fnl/setup-cmp.fnl

33 lines
941 B
Plaintext
Raw Normal View History

2023-07-28 14:26:18 +00:00
(let
[cmp (require :cmp)
luasnip (require :luasnip)
vscode-snips (require :luasnip.loaders.from_vscode)
2023-07-28 14:33:23 +00:00
{: cmp-mapping} (require :personalize)
2023-07-28 14:26:18 +00:00
]
(vscode-snips.lazy_load)
(luasnip.config.setup)
(cmp.setup
{:snippet {:expand #(luasnip $1)}
2023-07-28 14:33:23 +00:00
:mapping (cmp.mapping.preset.insert cmp-mapping)
2023-07-28 14:26:18 +00:00
: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}])
}))