Sublime Forum

Vintage ctrl+[ not working

#1

I enabled ctrl keybindings and all keys except ctrl+[ (ESC) seem to be working. There are no other keybindings configured except Default and Vintage:

[ctrl+[]
unindent Default
exit_insert_mode Vintage [{“key”: “setting.command_mode”, “operand”: false}, {“key”: “setting.is_widget”, “operand”: false}, {“key”: “setting.vintage_ctrl_keys”}]
exit_visual_mode Vintage [{“key”: “setting.command_mode”}, {“key”: “num_selections”, “operand”: 1}, {“match_all”: false, “operator”: “equal”, “key”: “selection_empty”, “operand”: false}, {“key”: “setting.vintage_ctrl_keys”}]
vi_cancel_current_action Vintage [{“key”: “setting.command_mode”}, {“key”: “vi_has_input_state”}, {“match_all”: false, “operator”: “equal”, “key”: “selection_empty”, “operand”: true}, {“key”: “setting.vintage_ctrl_keys”}]

I am on Windows and haven’t changed any configuration except enabling vintage and ctrl keybindings, nor installed any mods (except FindKeyConflicts to get the keybindings above).

0 Likes

#2

[edit]
Whoops, misread your question there; I assume you actually already have that setting enabled. I tested this on my windows machine and it works fine there, so apart from a settings issue the only thing I can think of that might cause such a problem would be if something else is perhaps consuming the key or there is something else in the binding that is causing a problem.

I would try opening the console with View > Show Console and then enter the following commands:

sublime.log_commands(True)
sublime.log_input(True)

Then press the key combination and check the console. If you don’t see it telling you that you pressed Ctrl+[, that could be an indication that something else is stealing the key before Sublime can see it (examples being a system global shortcut, something bound to an AutoHotKey script, etc).

If you see the key and some other command executing (or none at all) that’s a different avenue of investigation.
[/edit]


Per the official documentation on Vintage mode, you need an extra setting to enable those keys:

Vintage supports these ctrl key bindings:

  • Ctrl+[: Escape
  • Ctrl+R: Redo
  • Ctrl+Y: Scroll down one line
  • Ctrl+E: Scroll up one line
  • Ctrl+F: Page Down
  • Ctrl+B: Page Up

However, because they conflict with other Sublime Text key bindings, these are disabled by default on Windows and Linux. They can be enabled with the vintage_ctrl_keys setting:

So what you need to do is add the following to your user preferences if you want to use those keys:

    "vintage_ctrl_keys": true

You can see this is the case if you look at Vintage/Default.sublime-keymap, where there are two sets of key bindings for such commands, that differ by having an extra context item that requires the setting to be enabled:

    { "keys": ["escape"], "command": "exit_insert_mode",
        "context":
        [
            { "key": "setting.command_mode", "operand": false },
            { "key": "setting.is_widget", "operand": false }
        ]
    },
    { "keys": ["ctrl+["], "command": "exit_insert_mode",
        "context":
        [
            { "key": "setting.command_mode", "operand": false },
            { "key": "setting.is_widget", "operand": false },
            { "key": "setting.vintage_ctrl_keys" }
        ]
0 Likes