本文介绍了如何禁用 Sublime Text 3 中的片段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不禁用自动完成功能的情况下完全禁用 Sublime Text 3 片段功能?让编辑器用蹩脚的预输入代码块帮助"我只会减慢我的速度.我更喜欢让我自​​己输入代码.

How do I completely disable the Sublime Text 3 snippets feature without disabling autocompletion? Having the editor "help" me with crappy pre-typed code blocks just slows me down. I'd prefer it just let me type code myself.

推荐答案

删除 Sublime Text 3 代码段有点麻烦,因为它们直接存储在包中.但是可以通过在 packages 文件夹中添加具有相同名称的代码段来覆盖它们.

To remove Sublime Text 3 snippets is a bit cumbersome as they are stored directly in the packages. But they can be overwritten by adding a snippet with the same name in the packages folder.

为了让生活更轻松,有一个名为 PackageResourceViewer 的包可用在包控制中.安装它并运行 PackageResourceViewer: Extract Package.然后选择要禁用的片段的语言.所有文件现在都复制到您的 Packages 文件夹(每种语言的子文件夹).你可以编辑 .sublime-snippet.sublime-completions 文件.如果您只是想禁用该代码段,请删除其文件的所有内容并保存.空文件被视为没有片段.

To make life a bit easier there is a package called PackageResourceViewer available in Package Control. Install it and run PackageResourceViewer: Extract Package. Then choose the language which snippets you want to disable. All files are now copied to your Packages folder (a subfolder for each language). You can edit the .sublime-snippet or .sublime-completions files. If you simply like to disable the snippet remove all content of its file and save it. Empty files are considered as if there was no snippet.

我知道这仍然有点麻烦,但这是我知道的唯一方法,直到开发人员添加关闭代码段的选项.

I know this is still a bit cumbersome but the only way I know until the developer adds an option to turn snippets off.

此外,它指出值得一提的是,当然最好删除所有(通过 PackageResourceViewer)生成的文件,除了您要修改的文件.否则,如@Tobia 在评论中指出的那样,如果软件包稍后更新,您将不会收到任何这些文件的更新.

In addition it pointed out to be important to mention, that of course it is a good idea to delete all (by PackageResourceViewer) generated files except for the ones you wish to modify. Otherwise you won't receive updates on any of these files if a package gets updated later as @Tobia pointed out in his comment.

这篇关于如何禁用 Sublime Text 3 中的片段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 11:04