Sublime Forum

How to cancel autocompletion?

#1

Many times, Sublime offers me an autocompletion list that does not include the option I want. My intuition when I want to cancel an action is to press Escape, but when I press Escape in Sublime, it commits the highlighted autocomplete.

For example, if I’m typing a locale files in Rails, I might want to translate “cancel” as “Cancel”:

en:
cancel: Cancel

If I’m not very careful, Sublime, will autocomplete the second word as “cancel”, i.e. the case is wrong.

I want the autocomplete to work on Enter (at least if I have moved the cursor to select an autocomplete item), so “auto_complete_commit_on_tab”: true doesn’t help.

How do I cancel the autocomplete and close the list of choices? Can that be done on Escape?

Thanks,

Mark

0 Likes

#2

hmmm… Escape should cancel the autocompletion. Do you have any plugins installed? I seem to recall that the plugin sublime_text_alternative_autocompletion uses escape to cycle through autocompletions.

An easy way to tell what’s going on is by opening the console (control + `) and typing the following: sublime.log_commands(True)Then type something that will trigger the autocomplete. When you press escape to cancel, check what appears in the console. It should say something like command: hide_auto_complete Let me know if it says something different.

0 Likes

#3

Interesting…if the console is open, the autocomplete DOES cancel on Escape.

So yeah, I found Sublime from Michael Hartl’s Rails Tutorial and blindly followed his setup recommendations. it turns out this behavior is coming from alternative_autocomplete. (Apparently autocompletion on Escape is a Mac thing.)

I’ll try the plugin’s alternative alternative, mapping the Tab key in Default (Linux).sublime-keymap.

Thanks for the quick help,

Mark

P.S. Meta question: how do I subscribe to this forum topic? I can’t find a “Subscribe” or “Watch” link.

0 Likes

#4

Sorry, not possible.

0 Likes

#5

You might want to set:

“auto_complete_commit_on_tab”: true

In your User - Preferences…

That way you only commit on TAB.

0 Likes