question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom <Esc> key binding "jj" stoped working when entering insert mode from "cw"

See original GitHub issue

Describe the bug Leaving insert mode with a custom key binding does not work if you entered insert mode from a “cw” command.

To Reproduce Steps to reproduce the behavior:

map "jj" to <Esc> with

 "vim.insertModeKeyBindings": [
        {
            "before": ["j", "j"],
            "after": ["<Esc>"]
        }
    ]
  1. hit "i" to enter insert mode and write some text. Press "jj" to confirm it leaves insert mode.
  2. go to the start of the text/word and hit "cw" to change the word.
  3. hit "jj"
  4. just keeps rendering the letter "j" and does not leave insert mode as it should.

Expected behavior When entering insert mode with "cw" typing "jj", if mapped to <Esc>, should indeed exit insert mode considering it works fine when hitting "i" then hitting 'jj".

Screenshots vscode

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 0.16.6
  • OS Version: Darwin x64 17.7.0
  • VSCode version: 1.27.2

Additional context

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:33
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

17reactions
shawnaxsomcommented, Oct 3, 2018

Bug fix PR is up. Remappings should work in this case if an operator combination results in leaving normal mode. I added a test as well to make sure we don’t have future regressions.

10reactions
sarinkcommented, Oct 4, 2018

As a temporary workaround in the meantime, you can downgrade this extension to the previous version:

  1. Download: https://github.com/VSCodeVim/Vim/releases/download/v0.16.5/vim-0.16.5.vsix
  2. From the VSCode Command Palette (cmd+shift+P), select Extensions: Install from VSIX...
  3. Choose the old vsix file, and override the current version with the old one
  4. ciwHooray!jj
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapping using <Esc> writes "<Esc>" in insert mode rather ...
1 Answer 1 ... Key specifiers using the <...> syntax are incompatible with the traditional vi and are specific to Vim. This particular...
Read more >
Traversing text in Insert mode - vim - Stack Overflow
hjkl. This will make Alt + h in Insert mode go one character left, Alt + j down and so on, analogously to...
Read more >
What is your <esc> alias in insert mode? : r/vim - Reddit
My biggest problem with the jj , jk , kj and all of these is the input lag for typing these characters in...
Read more >
Documentation — Configuration - Vrapper - SourceForge
Vrapper is an eclipse plugin which acts as a wrapper for eclipse text editors to provide a Vim-like input scheme for moving around...
Read more >
EE 260 Lab 0: Introduction to LogicWorks and Unix
To get out of insert mode type ESC (the escape key). If you do not have an escape key, try typing control-[. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found