nvim: add some comments in autocomplete.lua and plugins.vim for <CR>

This commit is contained in:
Hedy Li 2021-08-22 17:54:40 +08:00
parent 72048a8197
commit f279cff8be
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
2 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,11 @@ _G.s_tab_complete = function()
end
-- Mappings
-- Note that some mappings are also in bottom of plugins.vim
-- Note that some mappings are also in bottom of plugins.vim
-- vim.api.nvim_set_keymap(
-- "i", "<CR>", "compe#confirm(luaeval(\"require 'nvim-autopairs'.autopairs_cr()\"))",
-- {expr = true }
-- )
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})

View File

@ -149,6 +149,7 @@ if has("nvim-0.5")
" compe mappings for nvim-autopairs
inoremap <silent><expr> <C-Space> compe#complete()
" endwise remaps <CR> though so it doesn't work
inoremap <silent><expr> <CR> compe#confirm(luaeval("require 'nvim-autopairs'.autopairs_cr()"))
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })