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.

[Question] Insert mode mappings

See original GitHub issue

Hello! Thank you for such an awesome plugin! Absolutely love it! ❤️

I’ve been trying to set up a few keymappings for insert mode. Most of them are not of a big importance, but this one is an absolute must for me and it doesn’t work:

imap jj <Esc> :call VSCodeNotify('vscode-neovim.escape')<CR>

It doesn’t even trigger the chord on the first j, like no reaction whatsoever.

Am I doing something wrong? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
asvetliakovcommented, Nov 23, 2019

Yes, something like jj or jk for the escape key won’t work. And i have no plans to listen to events in insert mode unless this or this will be fixed. Sorry for inconvience!

2reactions
bogdan0083commented, Nov 23, 2019

Alright, I figured it out. Adding the keymap to vscode’s keybindings.json with neovim.mode == insert works great!

    {
        "key": "j j",
        "command": "vscode-neovim.escape",
        "when": "editorTextFocus && neovim.mode == insert"
    }

It’s probably a good idea to add a note on how to add key mappings for insert mode (with the above example). I’ll send a PR tomorrow if you don’t mind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert mode mapping to leave insert mode then invoke a ...
This happens because the <Plug> command is itself a mapping defined by a plug-in, so you need recursive mappings in this case for...
Read more >
Vim key mappings in insert mode - Stack Overflow
vimrc file and mapped some commands. They are only working in normal mode. Is there any way to map commands in insert mode?...
Read more >
[question] telescope.nvim insert mode typing is conflict with ...
[question] telescope.nvim insert mode typing is conflict with own key mapping. I have my own key mapping like this: local function map(mode, lhs,...
Read more >
Mapping redo in insert mode VIM - Super User
Mapping redo in insert mode VIM · Ask Question ... How to remap a redo shortcut (Ctrl-R in normal) to Ctrl-Shift-Z in insert...
Read more >
Vim insert mode tips & tricks - sidebits
imap establishes mappings for insert mode. You might have used its more popular cousin, nmap. imap, just as iabbrev, is a way to...
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