38

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.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
Nathan Ridley
  • 33,766
  • 35
  • 123
  • 197

6 Answers6

59

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.

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.

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.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • 4
    You sir, are a champion. – Nathan Ridley Jan 24 '15 at 06:33
  • Unfortunately, the Go snippets seem to be in an XML .tmSnippet format which pops up an error on launch when you delete the contents. – Jehan Jan 13 '16 at 20:42
  • A plugin I use kept all its snippets in a `snippets/` subdirectory, so I renamed it, but to no avail. Turns out Sublime Text 3 will find the snippets anywhere, so I ended up just deleting them, which did the trick. – chbrown Jan 26 '16 at 01:53
  • "they can be overwritten by adding a snippet with the same name in the packages folder"...? For example? – juanitogan Apr 17 '16 at 01:39
  • 2
    This doesn't work, at least not anymore. When you delete the folder and restart sublime, it gets generated from somewhere again.. – busuu Nov 12 '16 at 20:51
  • @Milan You should not delete any folder or files at all. Please read my answer carefully again. You need to generate files and empty them. There need to be a file with no content. – Pᴇʜ Nov 14 '16 at 07:19
  • @Peh ah yes, I didn't read it carefully, now it works. Thanks – busuu Nov 17 '16 at 18:49
  • 1
    Thank you. I would like to add that you can (and probably should) delete all the other files in the generated folder, except for the ones you wish to modify or truncate. Otherwise you won't receive updates when the source package is updated. – Tobia Apr 18 '17 at 21:05
  • @Tobia Of course I should have mentioned that even if that looked obvious to me. I improved my answer. – Pᴇʜ Apr 19 '17 at 06:05
  • 1
    I wanted to disable snippets from a `tmSnippet` file and there emptying the file lead to XML parsing errors while starting Sublime. I had do include the minimal XML `` for Sublime to be happy about it and disable the snippet. – Sebastian Stern Sep 06 '17 at 10:42
5

I was trying to use Peh's answer above, but found that for Go, the snippets are encoded in XML-based .tmSnippet files. Deleting some or all of the XML resulted in annoying popups every time Sublime was launched. As a workaround, I replaced the tabTrigger definition with uncommon characters.

Before <key>tabTrigger</key> <string>for</string>

After <key>tabTrigger</key> <string>ø</string>

This prevents the snippet from being shown in the autocomplete menu, unless you are actually using the uncommon character in question.

Jehan
  • 2,701
  • 2
  • 23
  • 28
3

open your settings (like shift+cmd+p or use the menu),

add the following:

    "auto_complete": false,
    "auto_complete_include_snippets": false,
    "auto_complete_include_snippets_when_typing": false,

Tested in ST4 build 4113.

In future versions, search for "snippet" in the default settings on the left side.

est
  • 11,429
  • 14
  • 70
  • 118
1

In Sublime Text Settings, you can find it on line 446

// A list of wildcard patterns specifying which snippet files to ignore.
// For example, to ignore all the default C++ snippets, set this to
// ["C++/*"]
"ignored_snippets": [],

I'm using Sublime Text Build 4113

ilia_rr
  • 45
  • 1
  • 10
0

There is a package called "Snippet Destroyer"1. Try to use it.

  • Please provide more details and include an example. See [How to answer](https://stackoverflow.com/help/how-to-answer). – tomasantunes Jan 08 '22 at 11:02
-1

Do it manually. Go through this path

C:\Users*user\AppData\Roaming\Sublime Text 3\Packages\User

Here you will get your snippets files. Chose your expected one and edit or delete what you want.

NB: AppData is kept hide by default in windows.So, You have to enable (Hidden Items) from Views. Here , *user can differ according to user name.

Shahriar
  • 21
  • 2