Sublime Text选项卡关闭自动完成窗口

时间:2014-02-26 19:32:35

标签: autocomplete tabs sublimetext

我希望这是一个简短的问题。

当我开始输入Sublime Text 2/3时,会出现自动完成窗口。如果我按下tab,我会开始循环选择我所拥有的选项,这正是我想要的。但是,在我按下tab的同时,自动完成弹出窗口关闭。

是否有一些选项让弹出窗口保持活动状态,向我显示我当前所在的项目。 (与down键的行为相同)。所以我想在down密钥和tab密钥行为之间取得一些成果。

希望我已经足够准确地描述了这个问题。如果事情不明确 - 我很乐意提供更多细节。

谢谢!

4 个答案:

答案 0 :(得分:1)

我不太了解您正在寻找的行为,但这些是Preferences.sublime-settings中可用的完成设置:

{   
    // When enabled, pressing tab will insert the best matching completion.
    // When disabled, tab will only trigger snippets or insert a tab.
    // Shift+tab can be used to insert an explicit tab when tab_completion is
    // enabled.
    "tab_completion": true,

    // Enable auto complete to be triggered automatically when typing.
    "auto_complete": true,

    // The maximum file size where auto complete will be automatically triggered.
    "auto_complete_size_limit": 4194304,

    // The delay, in ms, before the auto complete window is shown after typing
    "auto_complete_delay": 50,

    // Controls what scopes auto complete will be triggered in
    "auto_complete_selector": "source - comment",

    // Additional situations to trigger auto complete
    "auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],

    // By default, auto complete will commit the current completion on enter.
    // This setting can be used to make it complete on tab instead.
    // Completing on tab is generally a superior option, as it removes
    // ambiguity between committing the completion and inserting a newline.
    "auto_complete_commit_on_tab": false,

    // Controls if auto complete is shown when snippet fields are active.
    // Only relevant if auto_complete_commit_on_tab is true.
    "auto_complete_with_fields": false
}

您可以通过自定义来获得所需的行为。

答案 1 :(得分:1)

如果你使用AutoSave插件,它将是快速关闭弹出窗口的原因。尝试禁用此扩展程序。

答案 2 :(得分:0)

覆盖Tab键绑定

我发现以下提供了解决方案。它只是再次调用自动完成功能,导致选择下一个选项。

{ "keys": ["tab"], 
    "command": "auto_complete",
    "context":
    [
        { "key": "auto_complete_visible" },
        { "key": "setting.auto_complete_commit_on_tab", "operand": false }
    ]
}

如果这不是唯一的按键绑定,请记住要添加逗号。

答案 3 :(得分:-1)

我有同样的问题 - 在他们的论坛中找到了这个解决方案:

将其添加到您的keymap文件中:

{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"}, "context":
   [
      { "key": "auto_complete_visible" },
      { "key": "setting.tab_completion", "operator": "equal", "operand": false }
   ]
}