Allow a key sequence binding like `j,k` to not prevent user from insert `j`
See original GitHub issueDescription of the new feature/enhancement
You can bind a key sequence like j,k
to a function or script block by Set-PSReadLineKeyHandler -Key 'j,k' -ViMode Insert -Function ViCommandMode
, but a user cannot insert a character j
after that.
Proposed technical implementation details (optional)
Quoted from https://github.com/PowerShell/PSReadLine/issues/1701#issuecomment-664020465
In vim, jk
or jj
to exit insert mode is super common. Usually it works like this:
- You press <kbd>j</kbd>
- <kbd>j</kbd> is written to the buffer
- A timer starts
- If you press the next key in the sequence before the timer is up, the
j
is removed from the buffer and the command fires - If the key you press next isn’t in the sequence, or the timer is up then it’s treated like a literal
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Using 'jk' to exit insert mode with key-chord or anything else
A key cannot be bound to two different commands. In particular, it cannot be bound to both self-insert-command (or equivalent), which inserts a ......
Read more >How to remap escape insert mode to 'jk' in fish shell?
I use jk as my escape sequence in vim as well as vi-mode for bash and zshell. How do I do this in...
Read more >Avoid the escape key | Vim Tips Wiki - Fandom
A problem with mapping a sequence like jj is that Vim will pause whenever you type j in insert mode (it is waiting...
Read more >Fish shell: Map jk to enter normal mode (in vi mode)
The key sequence of the binding is jk , and its command is to repaint. (The repainting is necessary if your prompt shows...
Read more >VSCode Neovim
Neovim is a fork of VIM to allow greater extensibility and integration. ... the key sequence to activate the binding "key": "ctrl+h", //...
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 Free
Top 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
This is what I added to my profile to make
jk
go to comand mode:Nah
jk
orjj
(what I use) to exit insert mode is super common. Usually it works like this:j
is written to the bufferj
is removed from the buffer and the command fires