From 77f5dd9693576af7fde80bdc99700f21eff01d6b Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 9 Feb 2022 17:53:48 +0100 Subject: WIP moving to all lua and new structure --- lua/alpha/completition.lua | 96 ---------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 lua/alpha/completition.lua (limited to 'lua/alpha/completition.lua') diff --git a/lua/alpha/completition.lua b/lua/alpha/completition.lua deleted file mode 100644 index 7140ca5..0000000 --- a/lua/alpha/completition.lua +++ /dev/null @@ -1,96 +0,0 @@ -local lspkind = require "lspkind" - -local luasnip = require("luasnip") -local cmp = require "cmp" -local cmp_autopairs = require('nvim-autopairs.completion.cmp') -cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) - -cmp.setup { - mapping = { - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.close() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.choice_active() then - luasnip.change_choice(1) - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - [""] = cmp.mapping.complete(), - }, - sources = { - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "path" }, - { name = "luasnip" }, - { - name = "buffer", - keyword_length = 5, - option = { - get_bufnrs = function() - local bufs = {} - for _, win in ipairs(vim.api.nvim_list_wins()) do - bufs[vim.api.nvim_win_get_buf(win)] = true - end - return vim.tbl_keys(bufs) - end - } - }, - }, - - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - formatting = { - format = lspkind.cmp_format { - with_text = true, - menu = { - buffer = "[buf]", - nvim_lsp = "[LSP]", - nvim_lua = "[api]", - path = "[path]", - luasnip = "[snip]", - } - } - }, - - experimental = { - native_menu = false, - - ghost_text = true, - } -} --- Setup lspconfig. - local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) - -- Replace with each lsp server you've enabled. - require('lspconfig')['emmet_ls'].setup { - capabilities = capabilities - } - -local Group = require("colorbuddy.group").Group -local g = require("colorbuddy.group").groups -local s = require("colorbuddy.style").styles - -Group.new("CmpItemAbbr", g.Comment) -Group.new("CmpItemAbbrDeprecated", g.Error) -Group.new("CmpItemAbbrMatchFuzzy", g.CmpItemAbbr.fg:dark(), nil, s.italic) -Group.new("CmpItemKind", g.Special) -Group.new("CmpItemMenu", g.NonText) -- cgit v1.2.3