custom <Esc> key binding "jj" stoped working when entering insert mode from "cw"
See original GitHub issueDescribe 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>"]
}
]
- hit
"i"
to enter insert mode and write some text. Press"jj"
to confirm it leaves insert mode. - go to the start of the text/word and hit
"cw"
to change the word. - hit
"jj"
- 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
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:
- Created 5 years ago
- Reactions:33
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
As a temporary workaround in the meantime, you can downgrade this extension to the previous version:
Extensions: Install from VSIX...
ciwHooray!jj