summaryrefslogtreecommitdiff
path: root/lua/lv-compe/init.lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-06-27 22:11:33 -0400
committerchristianchiarulli <[email protected]>2021-06-27 22:11:33 -0400
commit3009c6e5f667a450f39a792e17182c717bb2d751 (patch)
treeeb1f8bbf95ff291f7a4abce9412b50c2564b603c /lua/lv-compe/init.lua
parent1dbb05ed5de0927ede5d0fb0733498674aef8409 (diff)
use start now, for more speed
Diffstat (limited to 'lua/lv-compe/init.lua')
-rw-r--r--lua/lv-compe/init.lua54
1 files changed, 5 insertions, 49 deletions
diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua
index 7a5a4b1d..54ef2310 100644
--- a/lua/lv-compe/init.lua
+++ b/lua/lv-compe/init.lua
@@ -1,5 +1,6 @@
-vim.o.completeopt = "menuone,noselect"
+local M = {}
+M.config = function()
require'compe'.setup {
enabled = O.auto_complete,
autocomplete = true,
@@ -59,54 +60,6 @@ require'compe'.setup {
-- 
-- 
--- local t = function(str)
--- return vim.api.nvim_replace_termcodes(str, true, true, true)
--- end
-
--- local check_back_space = function()
--- local col = vim.fn.col('.') - 1
--- if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
--- return true
--- else
--- return false
--- end
--- end
-
--- -- Use (s-)tab to:
--- --- move to prev/next item in completion menuone
--- --- jump to prev/next snippet's placeholder
--- _G.tab_complete = function()
--- if vim.fn.pumvisible() == 1 then
--- return t "<C-n>"
--- elseif vim.fn.call("vsnip#available", {1}) == 1 then
--- return t "<Plug>(vsnip-expand-or-jump)"
--- elseif check_back_space() then
--- return t "<Tab>"
--- else
--- return vim.fn['compe#complete']()
--- end
--- end
--- _G.s_tab_complete = function()
--- if vim.fn.pumvisible() == 1 then
--- return t "<C-p>"
--- elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
--- return t "<Plug>(vsnip-jump-prev)"
--- else
--- return t "<S-Tab>"
--- end
--- end
-
--- vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
--- vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
--- vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
--- vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
-
-
-
-
-
-
-
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
@@ -154,3 +107,6 @@ vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", {noremap = true, s
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})
+end
+
+return M