Browse Source

fix: properly map nvim-compe keybinds

my-config
NTBBloodbath 3 years ago
parent
commit
e18ac64983
No known key found for this signature in database GPG Key ID: 18D6730BC846AAC5
  1. 14
      lua/doom/core/keybindings/init.lua

14
lua/doom/core/keybindings/init.lua

@ -47,24 +47,22 @@ utils.map('n', '<Space>', ':WhichKey <leader><CR>', opts)
-- If the LSP group is not disabled or the nvim-compe plugin is not disabled
-- then set its mappings.
if
--[[ not utils.has_value(Doom.disabled_modules, 'lsp')
and (not utils.has_value(Doom.disabled_plugins, 'compe')) ]]
functions.check_plugin('nvim-compe')
functions.check_plugin('nvim-compe', 'opt')
then
-- https://github.com/hrsh7th/nvim-compe#mappings
utils.map('i', '<expr> <C-Space>', vim.fn['compe#complete'](), opts)
utils.map('i', '<expr> <CR>', vim.fn['compe#confirm']('<CR>'), opts)
utils.map('i', '<expr> <C-e>', vim.fn['compe#close']('<C-e>'), opts)
utils.map('i', '<expr> <C-Space>', 'compe#complete()', opts)
utils.map('i', '<expr> <CR>', 'compe#confirm("<CR>")', opts)
utils.map('i', '<expr> <C-e>', 'compe#close("<C-e>")', opts)
utils.map(
'i',
'<expr> <C-f>',
vim.fn['compe#scroll']({ delta = '+4' }),
'compe#scroll({ "delta": +4 })',
opts
)
utils.map(
'i',
'<expr> <C-d>',
vim.fn['compe#scroll']({ delta = '-4' }),
'compe#scroll({ "delta": -4 })',
opts
)
utils.map('n', 'gd', ':lua vim.lsp.buf.definition()<CR>', opts) -- gd: jump to definition

Loading…
Cancel
Save