如何在Sublime Text中进入Vintage Command模式

时间:2013-02-02 23:42:27

标签: sublimetext2

我在OSX上。我很确定启用了Vintage模式(我在状态栏中看到INSERT MODE),但我无法进入COMMAND模式。我怎么做?转义键不起作用,正如我在一些教程中看到的那样。谢谢!

2 个答案:

答案 0 :(得分:10)

来自documentation -

Vintage starts in insert mode by default. This can be changed by adding:

"vintage_start_in_command_mode": true

to your User Settings.

然后 -

if you'd like to bind "jj" to exit insert mode, you can add this key binding:

{ "keys": ["j", "j"], "command": "exit_insert_mode",
    "context":
    [
        { "key": "setting.command_mode", "operand": false },
        { "key": "setting.is_widget", "operand": false }
    ]
}

答案 1 :(得分:2)

我发现以下在Preferences -> Key Bindings - User中很方便,因为它也退出了可视模式。注意大写的J和K,因为在视觉模式中你会想要使用j和k来移动。

  { "keys": ["J", "K"], "command": "exit_insert_mode",
    "context":
    [
      { "key": "setting.command_mode", "operand": false },
      { "key": "setting.is_widget", "operand": false },
      { "key": "setting.vintage_ctrl_keys" }
    ]
  },
  { "keys": ["J", "K"], "command": "exit_visual_mode",
      "context":
      [
          { "key": "setting.command_mode"},
          { "key": "num_selections", "operand": 1},
          { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false },
          { "key": "setting.vintage_ctrl_keys" }
      ]
  },