Sublime Forum

Disable snippets

#1

I’ve recently started to write a lot in JS and found one thing that drives me nuts. Whenever I type a colon ‘:’ and try to insert a bunch of spaces with ‘tab’ key, it paste ‘key: value’ text. Worse yet, when I add a single space and then hit ‘tab’, nothing happens at all.
Now I’ve found that similar things happen when I try to autocomplete ‘timeout’, and this led me to discovery of the dreary snippet feature. However, I couldn’t find an information how to disable it. I know that I can kill all the snippets individually, but that’s a hefty bit of unnecessary work.

So my question is: how to disable the dreadful snippet feature altogether?

0 Likes

#2

Not possible?

0 Likes

#3

I had this same problem, so I unbinded the tab key to autocomplete.

Solution: open Default(Windows).sublime-keymap (or your OS specific file) in the Default package. Find these lines and comment them out:

[code] { “keys”: “tab”], “command”: “insert_best_completion”, “args”: {“default”: “\t”, “exact”: true} },
{ “keys”: “tab”], “command”: “insert_best_completion”, “args”: {“default”: “\t”, “exact”: false},
“context”:

		{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
	]
},
{ "keys": "tab"], "command": "replace_completion_with_next_completion", "context":
	
		{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
		{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
	]
},[/code]
0 Likes

#4

shift+tab always insert a tab.

Very bad idea to modify core files when not necessary.
Better to override them in your user folder:

[code] { “keys”: “tab”], “command”: “insert”, “args”: {“characters”: “\t”} },
{ “keys”: “tab”], “command”: “insert”, “args”: {“characters”: “\t”},
“context”:

     { "key": "setting.tab_completion", "operator": "equal", "operand": true }
  ]

},
{ “keys”: “tab”], “command”: “insert”, “args”: {“characters”: “\t”}, “context”:

     { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
     { "key": "setting.tab_completion", "operator": "equal", "operand": true }
  ]

}[/code]

0 Likes