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

Loading…
Cancel
Save