summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/cfg/compe/init.lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-07 14:10:25 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-07 14:10:25 +0200
commit409dfed3237f9f0a6e96879078d1daf3d9c02e03 (patch)
treefd340e6803212b5ae401e2d6a1b524c412498663 /.config/nvim/lua/cfg/compe/init.lua
parent4918f8747e2d3e4d3342bb1f5ee05db6198819d1 (diff)
Updated config again after Chris's updates
Diffstat (limited to '.config/nvim/lua/cfg/compe/init.lua')
-rw-r--r--.config/nvim/lua/cfg/compe/init.lua10
1 files changed, 7 insertions, 3 deletions
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", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true })
- -- vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true })
+ vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true })
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true })
vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true })
vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true })