vim-visual-multi icon indicating copy to clipboard operation
vim-visual-multi copied to clipboard

C-n jumps to the start of the next line first time it is used

Open snikoletopoulos opened this issue 1 year ago • 9 comments

Describe the issue: I have the plugin installed with lazy.nvim and have it set up to not load lazily. When I type <C-n> instead of going to the next word the cursor jumps to the start of the next line. When I redo the steps it works normally

Steps to reproduce

  1. Go to a word
  2. <C-n>
  3. Cursor goes to the next line

  • Operating System: Mac OS 13.4
  • Vim Version: NVIM v0.9.0 Build type: Release
  • commit SHA/branch: latest

snikoletopoulos avatar Jun 29 '23 08:06 snikoletopoulos

There was a similar issue, but I can't find it, try #241.

mg979 avatar Jun 29 '23 14:06 mg979

I tried :echo VM_maps["Find Under"] it says I don't have it (E716: Key not present in Dictionary: "Find Under")

snikoletopoulos avatar Jul 02 '23 14:07 snikoletopoulos

When you start neovim, before starting VM for the first time, see what says

nmap <c-n>

mg979 avatar Jul 02 '23 18:07 mg979

No mapping found If I disable the plugin the cursor goes to the next line every time

snikoletopoulos avatar Jul 03 '23 07:07 snikoletopoulos

If I disable the plugin the cursor goes to the next line every time

Because it's the normal behaviour for c-n. I'm pretty sure it's an issue with the package manager and I don't know how to fix it. Try putting the plugin in pack/start or pack/opt then add it with packadd in your vimrc.

Also I don't understand how it can work the second time, since c-n isn't mapped.

mg979 avatar Jul 03 '23 09:07 mg979

The above https://github.com/BerkeleyTrue/dotfiles/commit/a3b4487d8d5dae88ab13901c5fa821fc4674ad77 fixed issue for me. ( lazy=false) . I think issue can be closed.

JoseConseco avatar Feb 23 '24 19:02 JoseConseco

With Lazy.nvim, even with lazy=false i still face the same issue

{
    "mg979/vim-visual-multi",
    lazy = false,
},

renxzen avatar Feb 23 '24 20:02 renxzen

ok, you are right - visual mode still did not work. My workaround is to call vm in any way, so that its keys gets loaded:

  {
    "mg979/vim-visual-multi", --multi cursor 
    config = function()
      vim.g.VM_mouse_mappings = 1
      vim.cmd[[VMDebug]]  -- fixes the  ctrl+n in visuala mode
    end,
  },

JoseConseco avatar Feb 24 '24 16:02 JoseConseco

Above answer didn't solve it, but helped by showing me the overwritten imap error in the debug message from #172

Disabling windwp/nvim-autopairs made the problem completely go away so i modified the lazy config like this. It definitely solved the issue.

	{
		"mg979/vim-visual-multi",
		init = function()
			vim.g.VM_maps = {
				["I BS"] = '',
			}
		end,
	},

renxzen avatar Feb 26 '24 23:02 renxzen