file modified when using `jj` as <Esc>
See original GitHub issueBUG REPORT:
What happened: when using jj as <Esc> (or other two keys combination) on not modified file it becomes modified
What did you expect to happen: keep file unmodified
How to reproduce it (as minimally and precisely as possible):
Remap <Esc> to jj
open file
go to insert mode, press jj
file not changed but vscode says it’s modified
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How do I prevent the delay when mapping jj to <ESC> in ...
I've recently mapped jj to <ESC> in insert mode for quick escaping. While everything is functional, I find the brief delay after typing...
Read more >Mapping "jj" to <ESC> causes cursor to try to jump forward
An easy way to do this on the whole file is to run :%s/\s\+$// ... "Don't use vi-compatibility mode set nocompatible.
Read more >Did you remap :wq? What about jj for Esc? : r/vim - Reddit
I use fd for escape, since it's faster than jj and is the default for spacemacs. Only problem I've had with it is...
Read more >Vim Tip: Remapping `jj` to Escape | by Eric Van Johnson
Edit your .vimrc file. vi ~/.vimrc. Add the following entry. imap jj <Esc>. note: you can see I have a similar mapping for...
Read more >Training Your Fingers - Learn Vimscript the Hard Way
Vim will act as if you pressed the escape key and return you to normal mode. ... Using jj in normal mode will...
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
EDIT
nope, my solution below isn’t working correctly.
obsolete solution
my current way to solve this is to set `jk` to: ``` "vim.insertModeKeyBindings": [ { "before": ["j", "k"], "after": ["<Esc>", "u", "u"] } ], ```
while
u
stands forundo
:hope this helps
this also deletes everything that you typed before pressing jk