Sublime Forum

Tab completion list order with snippets at the top

#1

When I use tab completion, about 70% of the time what I want is a snippet. But my snippets always appear at the end of the list. I’ve tried different settings for the ordering option, but that doesn’t change where the snippets go. I’d love to always place them at the top. What would be nice is if ST remembered my last selection and placed it at the top of the list next time.

Thank you

0 Likes

#2

What would be nice is if ST remembered my last selection and placed it at the top of the list next time.

See the "auto_complete_use_history" setting.

0 Likes

#3

I have that set to true, but it doesn’t change anything with snippets. I’ve tested and it is correctly ordering word completions by history, but the snippets remain at the bottom of the list regardless of their use.

0 Likes

#4

hello

You could try configuring your snippets with an example key combination if they are for javascript language. , add js at the beginning of the snippet , Something like. jssnippetname
then in settings (global) put this.

{“selector”: “text.js”, “characters”: “js”,},

so when you type js , all your snippets will appear on top.

Regards.

0 Likes

#5

I don’t think there’s a way to change the ordering, but using history it should trigger the same snippet when typing the same thing again. afaik snippets are also ordered near/at the top when their full trigger is typed.

0 Likes

#6

Thank you for the help. This post gave me an idea. My snippets are in a .sublime-completions file and the one I’ve been having the most annoyance from was a const completion. So I moved that one to a sublime-snippet file and it solved the problem.

0 Likes