【发布时间】:2014-10-12 19:07:17
【问题描述】:
我已经使用 Sublime Text 2 大约 3 周了,考虑将它用于我的新 IDE。但是,有一个功能让我非常抓狂。
自动完成功能的弹出频率大约是我需要它的 5 倍,如果我可以直接输入并忽略它就可以了。但是,当我按 Tab 键时,它会不断插入它所暗示的任何内容,并且在每一行上多次使用 Tab 键来格式化代码。这导致我不得不在我键入的几乎每一行代码上撤消自动完成。
我进入了首选项,它只是一个巨大的文本文件,并进行了以下更改:
// 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": false,
// 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,
我对 cmets 的解读是,这应该会导致自动完成仅在我按 Enter 时插入其建议,这正是我想要的。但是,它继续在选项卡上这样做。我是否设置错误,或者 ST2 中是否存在阻止用户关闭自动完成功能的错误?
编辑
为了澄清,我真的希望自动完成功能只有在我按下向下箭头选择列表中的某些内容然后按 Enter 时才会发生。没有我先选择一个项目,enter 和 tab 都不应该启动自动完成。
【问题讨论】: