Bladeren bron

fix(cmp): fix <C-j> and <C-k> keybindings not working

xeluxee 3 jaren geleden
bovenliggende
commit
92c07ed89f
2 gewijzigde bestanden met toevoegingen van 2 en 4 verwijderingen
  1. 2 0
      lua/lvim/core/cmp.lua
  2. 0 4
      lua/lvim/keymappings.lua

+ 2 - 0
lua/lvim/core/cmp.lua

@@ -204,6 +204,8 @@ M.config = function()
       { name = "crates" },
     },
     mapping = {
+      ["<C-k>"] = cmp.mapping.select_prev_item(),
+      ["<C-j>"] = cmp.mapping.select_next_item(),
       ["<C-d>"] = cmp.mapping.scroll_docs(-4),
       ["<C-f>"] = cmp.mapping.scroll_docs(4),
       -- TODO: potentially fix emmet nonsense

+ 0 - 4
lua/lvim/keymappings.lua

@@ -81,10 +81,6 @@ function M.config()
       ["<A-Down>"] = "<C-\\><C-N><C-w>j",
       ["<A-Left>"] = "<C-\\><C-N><C-w>h",
       ["<A-Right>"] = "<C-\\><C-N><C-w>l",
-      -- navigate tab completion with <c-j> and <c-k>
-      -- runs conditionally
-      ["<C-j>"] = { 'pumvisible() ? "\\<down>" : "\\<C-j>"', { expr = true, noremap = true } },
-      ["<C-k>"] = { 'pumvisible() ? "\\<up>" : "\\<C-k>"', { expr = true, noremap = true } },
     },
 
     ---@usage change or add keymappings for normal mode