guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

Escape with CTRL+[ #1043

Open fullofcaffeine opened 8 years ago

fullofcaffeine commented 8 years ago

I don't use ESC to go to the normal mode, but rather I've grown used to using CTRL+[, is there a way to set Vintageous to use it instead (or in addition to) ESC?

gerardroche commented 8 years ago

I think adding these keymaps will do it for you:

{"keys": ["ctrl+["], "command": "press_key",            "args": {"key": "<esc>"},           "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["ctrl+["], "command": "_enter_normal_mode",   "args": {"mode": "mode_insert"},    "context": [{"key": "vi_insert_mode_aware"}]},
ratiotile commented 8 years ago

I use a different binding. What is the difference between _enter_normal_mode and exit_insert_mode?

{ "keys": ["ctrl+["], "command": "exit_insert_mode",
    "context":
    [
        { "key": "setting.command_mode", "operand": false },
        { "key": "setting.is_widget", "operand": false }
    ]
},
srghma commented 7 years ago

Like @gerardroche, but with additions

  { "keys": ["ctrl+["], "command": "press_key",            "args": {"key": "<esc>"},        "context": [{"key": "vi_command_mode_aware"}]},
  { "keys": ["ctrl+["], "command": "_enter_normal_mode",   "args": {"mode": "mode_insert"}, "context": [{"key": "vi_insert_mode_aware"}]},
  { "keys": ["ctrl+["], "command": "clear_fields", "context":[  { "key": "has_next_field", "operator": "equal", "operand": true }] },
  { "keys": ["ctrl+["], "command": "clear_fields", "context":[  { "key": "has_prev_field", "operator": "equal", "operand": true }]},
  { "keys": ["ctrl+["], "command": "hide_panel", "args": {"cancel": true}, "context": [   { "key": "panel_visible", "operator": "equal", "operand": true } ]},
  { "keys": ["ctrl+["], "command": "hide_overlay", "context":[  { "key": "overlay_visible", "operator": "equal", "operand": true }]},
  { "keys": ["ctrl+["], "command": "hide_popup", "context":[  { "key": "popup_visible", "operator": "equal", "operand": true }]},
  { "keys": ["ctrl+["], "command": "hide_auto_complete", "context":[  { "key": "auto_complete_visible", "operator": "equal", "operand": true }]},