How can I use 'Tab' key to escape autocompletes?


#1

I use the the following sublime text key-binding heavily to escape auto completed brackets or semicolons.
It’s like the default behaviour in Aptana studio. Pressing tab key just takes you out of “function()” 's auto completed brackets so that you can press enter and continue writing new line.

This is the keybinding I use for sublime text

[
    { "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
      [
         { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
         { "key": "auto_complete_visible", "operator": "not_equal", "operand": true },
         { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
         { "key": "following_text", "operator": "regex_contains", "operand": "^(\\]|\\)|\\}|>|\\\"|'|\\;)", "match_all": true },
         { "key": "has_next_field", "operator": "not_equal", "operand": true }
      ]
   }
]

I really don’t like to switch to arrow keys to move my cursor around the brackets. Is there any other way to move it out of the brackets? how you guys do it?


#2

Rather than pressing a key to go to the end of the line and then pressing ENTER, I just use Cmd+ENTER to “open” a new line below the current line from anywhere on the line. (It’s called the editor:newline-below command.) And Shift+Cmd+ENTER (or editor:newline-above) “opens” a new line above the current line.


#3

I use editor:move-to-end-of-word.

'.workspace .editor':
  'ctrl-space': 'editor:move-to-end-of-word'

It is similar to what I used in Sublime. It works alright, but has some annoying aspects. Like if my cursor was left of )}, it doesn’t put your cursor inbetween the parenthesis and bracket, it just skips over both.


#4

Thank you! a lot leedohm and dsandstrom.

Anyway, I was doing a bit research on atom.io’s “keybindings” and I found that doc.

I was wondering if somewhere out there is a list of all keywords that can be used (such as ‘editor:move-to-end-of-word’). Is there a list of all such available keywords?


#5

The Command Palette (Cmd+Shift+P on OS X) is the canonical list of commands in any configuration of Atom.


#6

Thank you, I will sure have a look. you may close this thread now.


#7

I added a package that I think works better. See: https://atom.io/packages/non-navigation . It is new, so it is not fully tested. Also, I don’t know if you can use tab because in is assigned to snippets. But, maybe cmd or ctrl and tab.