From 72d448e384249103748ee83b587c45924e4bc44d Mon Sep 17 00:00:00 2001 From: sefidel Date: Thu, 10 Feb 2022 00:24:03 +0900 Subject: Initial commit --- fnl/nvrc/packs/cmp.fnl | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 fnl/nvrc/packs/cmp.fnl (limited to 'fnl/nvrc/packs/cmp.fnl') diff --git a/fnl/nvrc/packs/cmp.fnl b/fnl/nvrc/packs/cmp.fnl new file mode 100644 index 0000000..3b70af5 --- /dev/null +++ b/fnl/nvrc/packs/cmp.fnl @@ -0,0 +1,56 @@ +(import-macros {: set!} :nvrc.macro.opt) +(local cmp (require :cmp)) + +(set! completeopt "menuone,noselect") + +(local icons {:Text "(t)" + :Method "(m)" + :Function "(f)" + :Constructor "(cs)" + :Field "(s)" + :Variable "(v)" + :Class "(c)" + :Interface "(i)" + :Module "(m)" + :Property "(p)" + :Unit "(u)" + :Value "(v)" + :Enum "(e)" + :Keyword "(k)" + :Snippet "(sn)" + :Color "(co)" + :File "(fi)" + :Reference "(r)" + :Folder "(fl)" + :EnumMember "(em)" + :Constant "(cn)" + :Struct "(s)" + :Event "(ev)" + :Operator "(op)" + :TypeParameter "(tp)"}) + +(cmp.setup { + :formatting {:format (fn [entry vim-item] + (set vim-item.kind + (string.format "%s %s" + (. icons vim-item.kind) + vim-item.kind)) + (set vim-item.menu + (. {:nvim_lsp "[LSP]"} + entry.source.name)) + vim-item)} + :mapping {: (cmp.mapping.select_prev_item) + : (cmp.mapping.select_next_item) + : (cmp.mapping.scroll_docs (- 4)) + : (cmp.mapping.scroll_docs 4) + : (cmp.mapping.complete) + : (cmp.mapping.close) + : (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Replace + :select true}) + :Tab (fn [fallback] + (if (cmp.visible) (cmp.select_next_item)"") + (fallback)) + : (fn [fallback] + (if (cmp.visible) (cmp.select_next_item)"") + (fallback))} + :sources {1 {:name :nvim_lsp}}}) -- cgit 1.4.1