diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-07 22:32:53 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-04-07 22:32:53 +0200 |
commit | 71d538630b226da37e4ef21c5a84d6fad5f55421 (patch) | |
tree | 5f87a9c1194a556d12ffca79ea98a08d76af548e /fnl/config/cmp.fnl | |
parent | fa9a5c6b80b5b0ffdcddc4b1d1c6cfe887d0bb04 (diff) |
fix(load plugin): correct loading err
Diffstat (limited to 'fnl/config/cmp.fnl')
-rw-r--r-- | fnl/config/cmp.fnl | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl index f7e9c7b..3c1ac1d 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/config/cmp.fnl @@ -3,26 +3,17 @@ {autoload {nvim aniseed.nvim util util}}) -(local luasnip (let [(ok? luasnip) util.load-plugin :luasnip] - (when ok? - (do - (require :luasnip/loaders/from_vscode).lazy_load) - luasnip))) -(local lspkind (let [(ok? lspkind) util.load-plugin :lspkind] - (when ok? - lspkind))) - -(lspkind.init) - -(defn- snip [args] - (luasnip.lsp_expand args.body) - -(let [(ok? cmp) util.load-plugin :cmp] - (when ok? +(let [cmp (util.load-plugin :cmp) + lspkind (util.load-plugin :lspkind) + luasnip (util.load-plugin :luasnip)] + (do + ((require :luasnip/loaders/from_vscode).lazy_load) + (lspkind.init) (cmp.setup { :snippet { - :expand snip} + :expand (fn [args] + (luasnip.lsp_expand args.body))} :mapping { "<C-k>" (cmp.mapping.select_prev_item) "<C-j>" (cmp.mapping.select_next_item)} |