在sublime text 4中,它会建议上下文词,我想禁用该功能。
例如,我输入wh,我将得到一个"while snippet“。

当文件有"while“单词时,我键入wh,我将得到"while”单词和"while snippet",我必须向下移动以选择"while snippet“。

"auto_complete_use_index": false,不工作。
有没有办法禁用第一个"while“字。
发布于 2022-01-24 09:27:35
如果您不想完全禁止字/缓冲区完成,您可以创建一个插件,如下所示(工具菜单-> Developer ->新插件...并将占位符替换为以下内容):
import sublime, sublime_plugin
class InhibitWordCompletionsEventListener(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
return sublime.CompletionList([sublime.CompletionItem.command_completion('', 'noop')], sublime.INHIBIT_WORD_COMPLETIONS)确保将其保存在ST推荐的文件夹(即Packages/User/)中,扩展名为.py。
然后,当您键入Python时,ST将不会建议使用while这个词,而是建议使用wh代码片段。
注意:这感觉有点像黑客,在未来的ST版本中它可能不会以这种方式工作,但我在4125上测试了它,它在那里工作。
如果您确实希望完全禁用缓冲区完成,请参见How to remove words in the current buffer from Sublime Text 4 autocomplete list。
发布于 2021-11-03 15:56:25
在我对版本4121的测试中,我得到了以下结果:
"auto_complete_include_snippets": false, --OK
"auto_complete_use_index": false, -- no work
"index_files": false, -- no work鉴于此,您可以尝试以下设置:
"auto_complete_include_snippets" https://stackoverflow.com/questions/69439575
复制相似问题