Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keymap not work with plugin vim-visual-multi #406

Open
2 tasks done
jheroy opened this issue Nov 29, 2024 · 2 comments · May be fixed by #487
Open
2 tasks done

Keymap not work with plugin vim-visual-multi #406

jheroy opened this issue Nov 29, 2024 · 2 comments · May be fixed by #487
Labels
bug Something isn't working keymap

Comments

@jheroy
Copy link

jheroy commented Nov 29, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

The keymap becomes ineffective in Vim-Visual-Multi mode. When entering multi-cursor editing mode with Vim-Visual-Multi, if a completion menu pops up and any keymap is used (e.g., pressing Enter to select the current item), the keymap stops working. Furthermore, even after exiting Vim-Visual-Multi's multi-cursor mode, the keymap remains broken, requiring a restart of Neovim to restore functionality.

Relevant configuration

No response

neovim version

NVIM v0.10.2 Build type: RelWithDebInfo LuaJIT 2.1.1727870382

blink.cmp version: branch, tag, or commit

main

@jheroy jheroy added the bug Something isn't working label Nov 29, 2024
@dpetka2001
Copy link

dpetka2001 commented Dec 11, 2024

Presumably you're using the keymap.preset = "enter" if I'm guessing right. You should change the mapping of vim-visual-multi to something else. Something like the following

  {
    "mg979/vim-visual-multi",
    init = function()
      vim.g.VM_theme = "purplegray"
      vim.g.VM_mouse_mappings = 1
      -- vim.schedule(function()
      vim.g.VM_maps = {
        ["I BS"] = "",
        ["Goto Next"] = "]v",
        ["Goto Prev"] = "[v",
        ["I CtrlB"] = "<M-b>",
        ["I CtrlF"] = "<M-f>",
        ["I Return"] = "<S-CR>",
        ["I Down Arrow"] = "",
        ["I Up Arrow"] = "",
      }
      -- end)
    end,
  },

I'm not sure if the vim.schedule is actually needed. I read somewhere about it, but for me it works without vim.schedule as well (try to see what works for you). This way I remap the <CR> of vim-visual-multi to something else and am able to accept suggestions from blink.cmp.

Without this I also experienced the same problem you described, but that is because when you enter vim-visual-multi mode the mapping <CR> gets overwritten by vim-visual-multi and then you can't use it any more with blink.cmp.

@Saghen Saghen linked a pull request Dec 11, 2024 that will close this issue
@jheroy
Copy link
Author

jheroy commented Dec 12, 2024

@dpetka2001 Thank you, this works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keymap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants