about summary refs log tree commit diff
path: root/fnl/nvrc/packs/blink-cmp.fnl
blob: f8183933c4ad14418b0ad6824654147148b5a678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
(local {: setup} (require :blink.cmp))

(setup {:keymap {:<Tab> [(fn [cmp]
                           (if (cmp.snippet_active) (cmp.accept)
                               (cmp.select_next))) "fallback"]
                 :<S-Tab> ["select_prev" "snippet_backward" "fallback"]
                 :<CR> ["accept" "fallback"]
                 :<Backspace> ["cancel" "fallback"]
                 :<C-Space> ["show" "show_documentation" "hide_documentation"]
                 :<C-e> ["hide" "fallback"]
                 :<C-d> ["scroll_documentation_down" "fallback"]
                 :<C-f> ["scroll_documentation_up" "fallback"]
                 :<A-1> [(fn [cmp] (cmp.accept {:index 1}))]
                 :<A-2> [(fn [cmp] (cmp.accept {:index 2}))]
                 :<A-3> [(fn [cmp] (cmp.accept {:index 3}))]
                 :<A-4> [(fn [cmp] (cmp.accept {:index 4}))]
                 :<A-5> [(fn [cmp] (cmp.accept {:index 5}))]
                 :<A-6> [(fn [cmp] (cmp.accept {:index 6}))]
                 :<A-7> [(fn [cmp] (cmp.accept {:index 7}))]
                 :<A-8> [(fn [cmp] (cmp.accept {:index 8}))]
                 :<A-9> [(fn [cmp] (cmp.accept {:index 9}))]
                 :<A-0> [(fn [cmp] (cmp.accept {:index 10}))]
                 :<A-=> ["select_next" "fallback"]
                 :<A--> ["select_prev" "fallback"]
                 :<Up> ["select_prev" "fallback"]
                 :<Down> ["select_next" "fallback"]}
        :appearance {:kind_icons {:Text "(t)"
                                  :Method "(f)"
                                  :Function "(f)"
                                  :Constructor "(C)"
                                  :Field "(s)"
                                  :Variable "(v)"
                                  :Property "(p)"
                                  :Class "(C)"
                                  :Interface "(I)"
                                  :Struct "(S)"
                                  :Module "(M)"
                                  :Unit "(U)"
                                  :Value "(V)"
                                  :Enum "(e)"
                                  :EnumMember "(e)"
                                  :Keyword "(k)"
                                  :Constant "(c)"
                                  :Snippet "(x)"
                                  :Color "(t)"
                                  :File "(t)"
                                  :Reference "(*)"
                                  :Folder "(t)"
                                  :Event "(e)"
                                  :Operator "(o)"
                                  :TypeParameter "(k)"}}
        :sources {:default [:lsp :path :snippets :buffer]}
        :signature {:enabled true} ; experimental signature support
        :fuzzy {:prebuilt_binaries {:download false}}
        :completion {:list {:selection {:preselect false :auto_insert true}}
                     :menu {:draw {:treesitter [:lsp]
                                   :columns [
                                             {1 :item_idx}
                                             {1 :label 2 :label_description}
                                             {1 :kind_icon :gap 1 2 :kind}
                                             {1 :source_name}]
                                   :components {:item_idx {:text (fn [ctx] (tostring ctx.idx))
                                                           :width {:max 2}
                                                           :highlight :BlinkCmpItemIdx}
                                                :label_description {:width {:max 10}}
                                                :source_name {:text (fn [ctx] (.. "[" ctx.source_name "]"))}}}}}})