Christopher
Christopher

Reputation: 2057

Autocomplete on space in SublimeText 2

I'd like the autocomplete function of SublimeText 2 to insert the currently selected option when I hit space (like IntelliSense in VisualStudio).

I've read this question, and tried to modify the solution (it's a custom key binding). But the best I got is this, and this deletes whatever I begun to write instead of completing it:

{ "keys": [":"], "command": "replace_completion_with_auto_complete", "context":
    [
        { "key": "setting.tab_completion", "operator": "equal", "operand": true }
    ]
}

Upvotes: 1

Views: 32

Answers (1)

r-stein
r-stein

Reputation: 4867

To summarize your question: You want to commit the autocompletion on space, if it is visible. The corresponding keybinding is:

{
    "keys": [" "], "command": "commit_completion", "context":
    [
        { "key": "auto_complete_visible" }
    ]
},

Upvotes: 2

Related Questions