(let [cmp (require :blink.cmp) (ok-luasnip luasnip) (pcall require :luasnip) config-snippets (if ok-luasnip {:expand (fn [snippet] (luasnip.lsp_expand snippet)) :active (fn [filter] (if (and filter filter.direction) (luasnip.jumpable filter.direction) (luasnip.in_snippet))) :jump (fn [direction] (luasnip.jump direction))} {}) config-sources-providers (if (pcall require :cmp_tabnine.config) {:cmp_tabnine {:name :cmp_tabnine :module :blink.compat.source}} {})] (cmp.setup {:keymap {:preset :none : [:accept :fallback] : [:cancel :fallback] : [(fn [cmp] (if (cmp.snippet_active) (cmp.accept) (cmp.select_next))) :snippet_forward :fallback] : [:select_prev :snippet_backward :fallback] : [:select_prev :fallback] : [:select_next :fallback] : [:show :show_documentation :hide_documentation] : [:scroll_documentation_up :fallback] : [:scroll_documentation_down :fallback] : [:hide :fallback]} :completion {:list {:selection :manual} :menu {:min_width 20 :max_height 25} :documentation {:auto_show true :window {:border :rounded}} :ghost_text {:enabled false}} :signature {:enabled true} :snippets config-snippets :sources {:default [:lsp :cmp_tabnine :path :luasnip :buffer] :providers config-sources-providers} :fuzzy {:prebuilt_binaries {:download false :force_version nil}}}))