Vim: <C-n> not working in 1.10.0

Created on 28 Aug 2019  路  7Comments  路  Source: VSCodeVim/Vim

Describe the bug
In my settings I have <C-n> remapped to "g b", and have been using it like that for well over a year. Today it stopped working in the middle of editing a file, and I had to revert to version 1.9.0 to have it working again.

I noticed the when expression has changed in v1.10.0, to something more complicated.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following to settings.json
  2. "vim.visualModeKeyBindingsNonRecursive": [ { "before": ["<C-n>"], "after": ["g", "b"], } ], "vim.normalModeKeyBindingsNonRecursive": [ { "before": ["<C-n>"], "after": ["g", "b"], } ],
  3. Place your cursor in a word in normal mode
  4. Press <C-n> a few times
  5. Notice the cursor moves down a line each time

Expected behavior
The current word should be highlighted, followed by each repetition of the word for every keypress.

Environment:

  • Extension (VsCodeVim) version: v1.10.0
  • VSCode version: 1.37.1
  • OS: macOs Mojave 10.14.6
areremap kinbug

Most helpful comment

Just tried this on windows and it was opening a new file instead of doing the intended remapping

All 7 comments

Just tried this on windows and it was opening a new file instead of doing the intended remapping

Here's the when expression on the keybinding we contribute from package.json:
(editorTextFocus || vim.mode == 'SearchInProgressMode' || vim.mode == 'CommandlineInProgress') && vim.active && vim.use<C-n> && !inDebugRepl

And here's the when expression in keybindings.json:

(editorTextFocus || vim.mode == 'SearchInProgressMode' || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == ''CommandlineInProgress')'

Seems like it isn't parsing it correctly... are parentheses supported?

Edit: seems they're not. Since we need them to get precedence right, seems like we can't use || 馃檨
Edit: oh right, this wasn't just a nice-to-have: Activating extension 'vscodevim.vim' failed: command 'extension.vim_ctrl+n' already exists.

What is the solution then? Ctrl+N opens a new tab now, even deleting the VSCode keybinding for Ctrl+N does not bring back the expected behaviour.

EDIT: Okay. File-> Preferences -> Vim -> replace "when" condition by the longer expression in your commit. I was actually going crazy trying to figure out how I messed up the keybindings

Same issue happens on my Mac

frustrates me too! This has been my solution to the problem - another plugin :-)

https://github.com/jonsmithers/vscode-open-in-vim

any progress on this?

@aabccd021 This should be fixed - please create a new issue if you're seeing a similar problem

Was this page helpful?
0 / 5 - 0 ratings