Sublime Forum

How to disable autocomplete

#1

I don’t have any packages or plugins installed; in a C file if I type:

auto x<tab>

ST4 brings up a “completion window”. I do not want this — ST4 has a 0% chance of knowing what I want, and I have to dismiss it. I don’t know why ST4 suddenly has this behavior but it kind of sucks.

Here’s the settings I’ve tried, to no avail, to get ST4 to stop trying to autocomplete:

{
	"color_scheme": "Packages/User/Themes/Printer.tmTheme",
	"draw_white_space" : ["all"],
	"tab_completion" : false,
	"auto_complete" : false,
	"auto_complete_delay": 50000000000,
	"font_size": 10,
	"theme": "auto",
	"word_wrap": "false",
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": "all",
	"ensure_newline_at_eof_on_save": true,
	"auto_complete_triggers": [],
	"auto_complete_use_index": false,
	"auto_complete_include_snippets": false,
	"auto_complete_include_snippets_when_typing": false,
	"ignored_snippets": ["C++/*"],
}
0 Likes

Auto complete still occurs even though it is disabled
#2

The version is ST4 4143.

0 Likes

#3

A completion panel being disabled despite all auto completion settings being disabled indicates multiple snippets’ tabTriggers matching current input.

Default C++ package of ST doesn’t shippets or completions related to auto keywords.

If no 3rd-party package is installed the only remaining option may be snippets in User package.

0 Likes

#4

As afar as I can tell, the issue was that I was using a TextMate theme. I can reliably cause the issue to reproduce — and go away — by installing and removing the theme. The theme is very basic — written in XML, and designed for black&white printing.

0 Likes

#5

Seems rather unlikely, but that theme seems to ship some snippets then.

0 Likes

#6

I know it’s been two weeks, but I’m still getting tab completion when pressing tab. This sucks. My preferences are at the end of this message. I have no plugins of any sort installed. The version number is 4143, on macOS 13.3.1.
// Settings in here override those in “Default/Preferences.sublime-settings”,
// and are overridden in turn by syntax-specific settings.
{
“auto_complete”: false,
“tab_completion”: false,
“always_show_minimap_viewport”: true,
“draw_white_space”: [“all”],
“trim_trailing_white_space_on_save”: “all”,
“translate_tabs_to_spaces”: true,
“theme”: “Default.sublime-theme”,
“color_scheme”: “Celeste.sublime-color-scheme”,
“font_size”: 10,
“word_wrap”: false,
}

0 Likes

#7

12%20AM

0 Likes

Nothing stops tab from auto-suggestion and auto-complete
#8

The only way to fully disable snippet completions currently is with custom keybindings, eg:

{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
2 Likes

#9

Can someone explain how to do the keybindings thing (where, what menu, etc) that @bschaaf talked about?

I too absolutely hate all forms of tab completion. Thoroughly infuriating, especially when none of the Settings flags do anything to prevent it.

UPDATE
@bschaaf’s suggestion seems to work, but if you only do that, it will break select+tab to indent a bunch of selected lines all at once. Below is the fix to eliminate autocomplete but keep select+tab indentation:

  1. Go to Preferences | Keybindings
  2. Then add these lines of code in the right-hand pane between the pre-existing square brackets:
	{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
	{ "keys": ["tab"], "command": "indent", "context":
		[{ "key": "text", "operator": "regex_contains", "operand": "\n" }]
	},

There might be other things that break by doing this … I will just keep updating this post with problems + solutions as I encounter them.

0 Likes

#12

My issue is that, after Sublime Text [built 4152, Linux] has been ‘asleep’ (hasn’t had focus in a few hours), the first time I hit (press) ‘tab’ [key], it takes 10 to 20 presses to get a tab.
It seems like the ‘auto_completion’ is working to read the document and decided what ‘code’ or none at all, to offer up.

If I set ‘tab_completion’ to ‘true’ the only way to dismiss the context code box is to hit escape, and then hitting tab again gives me contex box, Again. there is No way to Just TAB.

Have You looked at the ‘Tab’ section of ‘default key bindings’, there’s a bunch.

{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
{ "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t", "commit_single": true},
	"context":
	[
		{ "key": "auto_complete_visible", "operand": false },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
		{ "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
	]
},
{ "keys": ["tab"], "command": "auto_complete", "args": {"snippets_only": true, "default": "\t"},
	"context":
	[
		{ "key": "auto_complete_visible", "operand": false },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "setting.tab_completion", "operator": "equal", "operand": false },
		{ "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
	]
},
{ "keys": ["tab"], "command": "expand_snippet", "context":
	[{ "key": "has_snippet" }]
},
{ "keys": ["tab"], "command": "reindent", "context":
	[
		{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
		{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
	]
},
{ "keys": ["tab"], "command": "indent", "context":
	[{ "key": "text", "operator": "regex_contains", "operand": "\n" }]
},
{ "keys": ["tab"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
	[
		{ "key": "overlay_has_focus", "operator": "equal", "operand": true  }
	]
},
{ "keys": ["tab"], "command": "next_field", "context":
	[{ "key": "has_next_field", "operator": "equal", "operand": true }]
},
{ "keys": ["tab"], "command": "commit_completion", "context":
	[{ "key": "auto_complete_visible" }]
},

PS, this issue aside, I’ve been using ST since 2 and will continue using : )

0 Likes

#13

My issue is that, after Sublime Text [built 4152, Linux] has been ‘asleep’ (hasn’t had focus in a few hours), the first time I hit (press) ‘tab’ [key], it takes 10 to 20 presses to get a tab.
It seems like the ‘auto_completion’ is working to read the document and decided what ‘code’ or none at all, to offer up.

Sublime Text has no sleeping feature or anything like that, there isn’t a difference between pressing tab after a few seconds or after a few hours of idle. Does it happen in safe mode?

0 Likes

#14

After 3 hours of reading hundreds of crap posts, his is the only thing that gave me back my tab key and prevented me from giving up on SublimeText entirely.
SMH.

0 Likes