Sublime Text 3: How to enable autocomplete with Tab and Enter / Return

10,097

Remembering Autocomplete Choice

The autocomplete is quite elaborate; when you choice to insert "program" when you have entered "pro", the selection will be different when, for instance, you have autocomplete after typing "pr".

Use Tab or Enter to Commit Auto Complete Selection

Use the following setting:

{ "auto_complete_commit_on_tab": false }

Auto completion will commit selection with either tab or enter.

Add Auto Complete Commit Keys:

Thanks to this web-page: https://sublimetext.userecho.com/communities/1/topics/4670-allow-setting-which-keys-commit-auto-complete for including instructions on how to add key-bindings so that you can commit auto-completion with more keys.

For example: commit auto complete selection with period:

{ "keys": ["."], "command": "commit_completion", "context": [{ "key": "auto_complete_visible" }, { "key": "setting.auto_complete_commit_on_tab", "operand": false }] }
Share:
10,097

Related videos on Youtube

Noffica
Author by

Noffica

Updated on September 18, 2022

Comments

  • Noffica
    Noffica over 1 year

    When I first select a choice with the Tab key from the list of choices, the autocomplete choice is not committed, when I come back and try again, it works.

    Why does it work the second time and fail the first time?

    Ideally, I would like the choice to commit an autocomplete choice with either, the Enter / Return key or the Tab key. Is that possible?

    "auto_complete": true,
    "auto_complete_commit_on_tab": true,
    "auto_complete_commit_trigger_characters":
    [
        ".",
        "Enter",
        "Tab"
    ],
    "auto_complete_delay": 50,
    "auto_complete_selector": "source, comment, text.plain",
    "auto_complete_size_limit": 4194304,
    "auto_complete_with_fields": true,
    "auto_find_in_selection": true,
    "auto_complete_triggers":
    [
        {
            "characters": "<",
            "selector": "text.html"
        }
    ],
    "tab_completion": false,