Sublime Forum

User Snippets not working properly

#1

I used to create a blank file and write for example “template” and press tab and it used to trigger my snippet and it would generate it. Now it doesn’t work anymore, and for it to work, it has to have at least one space and then write “template” and press enter. But this would destroy my whole template because every line will have space before starting, it’s so annoying.

0 Likes

Can I revert Sublime Text 4 tab behavior to be like ST3?
Snippets are not listed in auto complete popup anymore (ST4)
#2
1 Like

#3

It solves the problem, but now I have to press control+space and then enter to generate snippets, instead of just a tab. I don’t know why this changed.

0 Likes

#4

That’s explained in the issue. All snippet like functions have been condenced into auto-completion functionality. So insert_best_completion and friends (which were triggered via tab key) no longer exist.

You would just need to tweak your auto_complete selector to let auto completion trigger while typing in text scopes.

0 Likes

#5

And how could one do that? Crazy how complicated making such a simple and essential feature work turns out to be with Sublime Text 4…

0 Likes

#6
  1. Run Preferences: Settings from command palette
  2. add "auto_complete_selector": "text, source - comment - string" to the right view or modify an existing one accordingly,

Note
Perfectly matching snippet triggers still expand when hitting tab even without any settings changed.

Example: Open a new view, type lorem and hit tab key.

0 Likes

#7

For me, it was one of the plugins causing this. One plugin had “tab” as keyboard shortcut for some action.
Check if it’s the case by disabling some of the recent plugins that you may have installed.
If one of the plugins is causing this, then go into that plugins folder and look for .sublime-keymap file. See if one of the actions is associated with “tab” and then simply remove it.

0 Likes