From 71d538630b226da37e4ef21c5a84d6fad5f55421 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 7 Apr 2022 22:32:53 +0200 Subject: fix(load plugin): correct loading err --- fnl/config/cmp.fnl | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'fnl/config/cmp.fnl') 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 { "" (cmp.mapping.select_prev_item) "" (cmp.mapping.select_next_item)} -- cgit v1.2.3-70-g09d2