Sublime Forum

How to enable autocomplete for plain text?

#1

I mean, when I start typing a few letters, I’d like for autocomplete suggestions to show up as I type. I remember it worked for plain text files, too, but it doesn’t now. What setting do I need to change?

Thank you!

1 Like

#2

After some test, I have my setting a little garbled, but it looks like this, Preferences -> Settings - User.

"auto_complete_selector": "source, comment, text.plain, meta.tag, punctuation.definition.tag.begin, css",
0 Likes

#3

Thank you very much, my man.

0 Likes

#4

By the way, do you know where I can find all the tags and instructions on what is what, how to use them, etc.? I mean the “text.plain, meta.tag, …”. Is there a list of these?

0 Likes

#5

Thank very much,work fine!
is posible to you share the code to use the same autocompletion but for MaxScript format?
thanks in advance

0 Likes

#6

here is docs on autocomplete, and scopes
docs.sublimetext.info/en/latest/ … tocomplete
docs.sublimetext.info/en/latest/ … -selectors

0 Likes

#7

The idea is that you can define the scope when you want the autocomplete to trigger.

The default setting is a lot more conservative than tito’s:

"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

The first one means “all source code, except for comments” and the other means “all tags, except on the opening bracket”.

The only thing you need to append to this setting is the “, plain.text” for text files.

To find out the scope in any given instance, you can use a tool such as ScopeHunter.

@Makenson The autocomplete will trigger after the scope is available. In other words, after the syntax for the file has been defined for the view.

Edit: if, for some reason, you want the autocomplete to trigger all the time just use this:

"auto_complete_selector": "source, text",

Hope this helps,
Alex

2 Likes

Snippet tabTrigger does not work on all scopes when no scope defined as scope selector
#8

Thanks Alex, very informative! Changing… !!

0 Likes

#9

thanks very much is a pleasure to receive that kind of support when we are at the very beginning of learning App!

I have this user setting but for unknown reason for me my App continue to open the new file in plain text not in maxscript syntax and also wheni change from plain text to maxscript i don have the maxscript library usable for autocompletion.
some advice in my code?

{
	"extensions":
    
        "maxscript",
    ],
	"auto_complete_commint_on tab": true,
	"auto_complete_selector": "source, text",
	"auto_complete_triggers":
	
		{
			"characters": "qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP",
			"selector": "text, source, meta, string, punctuation, constant"
		}
	],
	"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme",
	"default_new_file_syntax": "Packages/maxscript/MaxScript.tmLanguage",
	"ensure_newline_at_eof_on_save": true,
	"fileTypes":
	
		"ms",
		"mse",
		"mcr"
	],
	"font_size": 12,
	"highlight_modified_tabs": true,
	"ignored_packages":
	
		"Vintage"
	],
	"name": "MaxScript",
	"new_file_syntax": "maxscript",
	"scope": "source.maxscript",
	"syntaxes": "Packages/MaxScript /maxscript.tmLanguage",
	"use_current_file_syntax": true
}
0 Likes

#10

I found this :https://sublime.wbond.net/packages/All%20Autocomplete
these package fix my need relate to autocompletion in maxscript syntax without to load a populate maxscript library
hope this help others with the same issue :smiley:

0 Likes

#11

Hello folks,

just in case someone wonders what these “source, text.plain, …” scopes are, and how to find out which is which. I found this little plugin very helpful: github.com/facelessuser/ScopeHunter

0 Likes

#12

Note: appending “, plain.text” did not work for me. I used “, text.plain” instead.

ST 3.0, 3143

0 Likes

Snippet tabTrigger does not work on all scopes when no scope defined as scope selector