From 409dfed3237f9f0a6e96879078d1daf3d9c02e03 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 7 Jul 2021 14:10:25 +0200 Subject: Updated config again after Chris's updates --- .config/nvim/lua/cfg/compe/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to '.config/nvim/lua/cfg/compe') diff --git a/.config/nvim/lua/cfg/compe/init.lua b/.config/nvim/lua/cfg/compe/init.lua index 5b86f27..f42e8ad 100644 --- a/.config/nvim/lua/cfg/compe/init.lua +++ b/.config/nvim/lua/cfg/compe/init.lua @@ -7,7 +7,7 @@ local M = {} vim.g.vsnip_snippet_dir = O.vnsip_dir M.config = function() - opt = { + local opt = { enabled = O.auto_complete, autocomplete = true, debug = false, @@ -39,8 +39,12 @@ M.config = function() -- for emoji press : (idk if that in compe tho) }, } + local status_ok, compe = pcall(require, "compe") + if not status_ok then + return + end - require("compe").setup(opt) + compe.setup(opt) local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) @@ -86,7 +90,7 @@ M.config = function() vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", { expr = true }) vim.api.nvim_set_keymap("i", "", "compe#complete()", { noremap = true, silent = true, expr = true }) - -- vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#close('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true }) -- cgit v1.2.3-70-g09d2