Skip to content

How to properly abort a command using the escape key? #40

@digitalmaster

Description

@digitalmaster

I'm trying to figure out how to get my escape key to reliably get me back to the initial state (normal mode, canceled any ongoing key chords).

The issue i'm facing now is that if I start typing a command like vi and decide that I no longer want to complete this sequence, hitting escape gets me out of visual mode but it doesn't abort the ongoing key chord.

I've looked through docs and examples but haven't been able to find a way to do this yet. Curious if there's an obvious way to do this?

Sidenote: The first issue I had with the escape key is that sometimes I had to press it multiple times to get back normal mode. I thought this a was a bug but then realized it was only happening when there was a suggestion visible. So first press would dismiss the suggestion, second press would put me back into normal mode. The escape key binding confirmed this behavior:

{
    "key": "escape",
    "command": "modaledit.enterNormal",
    "when": "editorTextFocus && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},

Once I realized that I just hit escape until I get the normal mode block cursor which works well for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions