Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sublimetext 3 disable autocomplete upon pressing enter [duplicate]

There is this behaviour of sublimetext that I want to disable/change:

when sublimetext shows popup of an autocomplete suggestion, if I press enter, it will autocomplete that suggestion instead of making a newline... I do not want that.

For example:

def getuname(filename):
    try:
        with open(filename) as fo:
            uname = json.load(fo)

    except FileNotFoundError:
        return None   <<<<<<<<<<<<<<<<<
    else:
        return username 

upon typing None and pressing enter, it would autocomplete None to FileNotFoundError since the letters in None are in FileNotFoundError.. I can press press space and then press enter but this really bothers me when writing code...

How can I disable this feature?

like image 874
Aiden Choi Avatar asked Oct 16 '25 21:10

Aiden Choi


1 Answers

If you go to Preferences > Settings > you can view a document Default/Preferences.sublime_settings that has a value:

"auto_complete_commit_on_tab": false

that you should change to true and then it will switch completion from using the Enter key to using Tab.

Documentation for auto_complete_commit_on_tab:

By default, auto complete will commit the current completion on enter. This setting can be used to make it complete on tab instead. Completing on tab is generally a superior option, as it removes ambiguity between committing the completion and inserting a newline.

Note: You should make the changes in the second file in the split context window (User/Preferences.sublime_settings).

like image 69
jackw11111 Avatar answered Oct 19 '25 12:10

jackw11111