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.

file modified when using `jj` as <Esc>

See original GitHub issue

BUG 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:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ybbondcommented, Feb 15, 2019

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 for undo:

"vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["u"],
      "after": [],
      "commands": [
        {
          "command": "undo",
          "args": []
        }
      ]
    }
]

hope this helps

1reaction
ddergcommented, Feb 13, 2019

this also deletes everything that you typed before pressing jk

Read more comments on GitHub >

github_iconTop 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 >

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