aboutsummaryrefslogtreecommitdiff
path: root/fnl/plugins/cmp.fnl
diff options
context:
space:
mode:
authoramelia squires <[email protected]>2024-10-22 23:40:30 -0500
committeramelia squires <[email protected]>2024-10-22 23:40:30 -0500
commit0b7b1684d87b7d0b01b5645713b413e317699fd0 (patch)
tree70d54faa4536e97894754e63061f0d2fad99079c /fnl/plugins/cmp.fnl
readme
Diffstat (limited to 'fnl/plugins/cmp.fnl')
-rw-r--r--fnl/plugins/cmp.fnl23
1 files changed, 23 insertions, 0 deletions
diff --git a/fnl/plugins/cmp.fnl b/fnl/plugins/cmp.fnl
new file mode 100644
index 0000000..8d13986
--- /dev/null
+++ b/fnl/plugins/cmp.fnl
@@ -0,0 +1,23 @@
+(local cmp (require :cmp))
+
+((. cmp :setup) {
+ :snippet {
+ :expand (fn [args]
+ (vim.snippet.expand args.body)
+ ;((. vim.fn "vsnip#anonymous") args.body) ;for older neovim version (< 0.10)
+ )}
+ :mapping (cmp.mapping.preset.insert {
+ :<C-b> (cmp.mapping.scroll_docs -4)
+ :<C-f> (cmp.mapping.scroll_docs 4)
+ :<C-Space> (cmp.mapping.complete)
+ :<C-e> (cmp.mapping.abort)
+ :<CR> (cmp.mapping.confirm {select true})
+ :<Tab> (cmp.mapping (cmp.mapping.select_next_item) [:i :s])
+ })
+ :sources (cmp.config.sources [
+ {:name :nvim_lsp}
+ ;{:name :vsnip}
+ ] [{:name :buffer}])
+ })
+
+