Tabbing out of brackets/paretheses/quotes


#1

I’ve scoured the web for a way to do this on Atom, but I can’t find any way to do so, as a key binding can’t have multiple roles.
Basically, I want to be able to tab normally, but I want to be able to press tab after parentheses are auto-generated and I type what I want in them in order to escape the closing parentheses/bracket/etc. Is there no way to do this in Atom?


Tabbing out of brackets
Tab through quotes, parentheses etc
#2

That’s not true. See the documentation here:

https://atom.io/docs/latest/behind-atom-keymaps-in-depth#overloading-key-bindings


#3

@leedohm is it possible for you guys to create me a shortcut that allows me to do the thing I described? Having difficulty attempting to make it happen.


#4

Given the amount of stuff that is already layered on the Tab key (snippets, autocomplete, and indentation at least), getting this to be bug free could be quite the undertaking. Typically I just use Cmd+Enter to insert a blank line after the current one and move the cursor there (since most of the time that I want to escape brackets, I just want to go to the next line anyway).

I’ll take a quick look, but I can’t promise anything.


Tab through quotes, parentheses etc
#5

@leedohm Thanks so much, means a lot.


#6

I created a quick package which I stored here:

I won’t have time to support it, so I have no intention of publishing it. If you want to use it, please fork it and tweak for your own use.

I have only verified that:

  1. When on a blank line, hitting Tab allows one to indent normally
  2. When on a line that has a closing paren after the current cursor position, pressing Tab moves the cursor to the location directly after the paren

I have not verified:

  1. Snippets still work
  2. Autocomplete still works
  3. That this approach will work reliably for other bracket types or any form of quotes

But it should get you started.


#7

Give non-navigation a try. As @leedohm has stated, tab is a bit overloaded and I was used to using ctrl-space, so that is what I’m using for Atom.


#8

What would a mac user use?


#9

Your best bet is probably just the end key as often the brackets/parenthesis are the last text on the line.