Sublime Forum

Vintage Mode Esc Should Hide AutoComplete and Exit Insert

#1

This is currently driving me nuts, and I don’t know of a good fix: with autocomplete now automatically popping up, hitting esc or ctrl+ should both kill the autocomplete window AND exit to normal mode, but there doesn’t seem to be a good way to do that right now.

0 Likes

#2

+1

0 Likes

#3

+1

0 Likes

#4

You could maybe make it run a macro that runs both the exit_insert_mode and hide_auto_complete commands. I’ve been playing around with it, but it’s not quite right yet.

In your User default keymap:

{ "keys": "escape"], "command": "run_macro_file",
        "args": {"file": "Packages/User/Really_Go_To_Command_mode.sublime-macro"},
        "context":
        
            { "key": "auto_complete_visible", "operator": "equal", "operand": true },
            { "key": "setting.command_mode", "operand": false },
            { "key": "setting.is_widget", "operand": false }
        ]
}

And your macro would be:

{"command": "hide_auto_complete"}, {"command": "exit_insert_mode"} ]

It’s a rough start, but is hopefully in the right direction.

1 Like

#5

Is it possible to have “command” be an array within the keybindings? As in:

[code]{ “keys”: “escape”],
“command”: “hide_auto_complete”, “exit_insert_mode” ],
“context”:

        { "key": "auto_complete_visible", "operator": "equal", "operand": true },
        { "key": "setting.command_mode", "operand": false },
        { "key": "setting.is_widget", "operand": false }
    ]

}[/code]

Edit: Tested and it isn’t possible. Maybe make a “commands” key available, like the “keys” key?

0 Likes

#6

Thank you for this!

0 Likes

#7

Thank you, nizur. I created this account just to thank you.

0 Likes