Sublime Forum

Nothing stops tab from auto-suggestion and auto-complete

#1

Hey there

Whenever I am typing, and my cursor is at the end of a word, and I hit the Tab key… a drop down auto-suggest menu drops down…

  1. Expected behaviour is that tab will “tab” (ie add spaces in the text I’m typing)… I don’t want to see any dropdown or suggestions
  2. If I hit tab twice, expected behaviour is that it will add two tabs worth of spaces… I don’t want the first tab to generate suggestions and the second tab to select and paste the first suggestion

Maybe allow a complete override in settings, or un-hijack the tab key and allocate autocomplete to another key or keys… or a setting that lets me choose the hotkeys for autocomplete?

It become really frustrating because i have tap spacebar after a word before using tab in the normal way, and I suppose you could argue sublime is not a word processor and tabs aren’t a thing, but I use tabs all the time to improve readability.

I’m using the latest sublime 3 free version (build 4152), and I’ve added the following to to the preference settings to no avail

{
“detect_indentation”: true,
“translate_tabs_to_spaces”: true,
“copy_with_empty_selection”: false,
“auto_match_enabled”: false,
“tab_completion”: false,
“auto_complete”: false,
“auto_complete_size_limit”: 0,
“auto_complete_delay”: 5000000,
“auto_complete_selector”: “”,
“auto_complete_triggers”:[],
“auto_complete_use_index”: false,
“auto_complete_commit_on_tab”: false,
“auto_complete_include_snippets”: false,
“auto_complete_include_snippets_when_typing”: false,
“index_files”: false,
“disable_completions”: true,
“auto_close_tags”:false,
“includeCompletionsForModuleExports”: false,
}

Any suggestions are greatly appreciated.

Thanks

0 Likes

#2

If you want tab to never do anything other than add a tab you can use a keybinding:

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

#3

Thanks bschaaf, but unfortunately that didn’t work. It turns the tab into a delete when trying to tab multiple lines. (ie. it only solves for tabbing on a single line), because it’s simply inserting a \t over whatever is highlighted.

However, you pointed me in the right direction… :+1::call_me_hand:

I’ve just updated all the default key-bindings for auto-suggestions, and this has resolved the issue

{ “keys”: [“ctrl+shift+tab”], “command”: “auto_complete”, “args”: {“mini”: true, “default”: “\t”, “commit_single”: true},
“context”:
[
/… etc…/
]
},

{ “keys”: [“ctrl+shift+tab”], “command”: “auto_complete”, “args”: {“snippets_only”: true, “default”: “\t”},
“context”:
[
/… etc…/
]
},

{ “keys”: [“ctrl+shift+tab”], “command”: “expand_snippet”, “context”:
[
/… etc…/
]
},

0 Likes

#4

Hacking key bindings shouldn’t be the only option to disable auto completions. Especially tab key is used in various contexts, so blumb customizations are likely to break other functions.

The OP’s settings should be enought to prevent completions. ST however triggers word completoins while typing in various circumstances, despite auto_complete: false being set.

related topics:

0 Likes

#5

This is maddening. Am I really the only person who thinks readability and tabbing is fairly critical? It’s the one thing I do continuously through the coding process. I’ve never actually needed to autocomplete… and a number of times I’ve had a bugs due to the autocompleting a variable name that looks similar to an existing variable name.

I was messing around a little more and now the autocompleting started happening again. I’ve restarted the program thinking it was just not cycling through… maybe I need to hard reset. But the spectre of auto-complete is back even with all the ctrl+shift+tab added to the bindings for autocomplete.

What actual percentage of time does the technical team at Sublime think autocomplete is used by coders?

[caveat: auto closing tags is the one and only exception for me, this for of autocomplete is useful, predictable, and doesn’t conflict with other typing intentions]

ps. go the 'tildas!!!

0 Likes

#6

What actual percentage of time does the technical team at Sublime think autocomplete is used by coders?

I am just a normal user, but according to what I’ve read in forum and on discord, good context sensitive autocompletion and other IDE like features have been one of the most wanted features during the last few years. Hence much effort has been put into supporting features and plugins like LSP reached quite some popularity.

Which features are important or useful however heavily depends on workload and personal preferences. ST as a general purpose code editor for pros tries to fulfill a wide range of requirements, which is rather hard with all the different languages and possible habbits and workflows.

I personally heavily rely on auto-completions and would rather like see more then less with that regard. A pure note taker or prose writer, however may have significant different expectations and needs.

I agree, features like auto completion should be fully configurable. As the tracking issue is assigned to a core dev a solution seems to be in the works.

0 Likes