Home Download Buy Blog Forum Support

Unindent using shift-tab

Unindent using shift-tab

Postby 16bytes on Thu Aug 11, 2011 7:05 pm

Unindent using shift-tab doesn't seem to work. I upgraded to 2101 from 2099 and am running on windows 7 64-bit because it looked like 2101 had a fix for unindent, but it still didn't work for me.

Triggering the unindent option from the edit menu works, however.

Also, is there a custom keybinding dialog somewhere, or would I have to add that to a global user-preference file?
16bytes
 
Posts: 6
Joined: Thu Aug 11, 2011 7:01 pm

Re: Unindent using shift-tab

Postby C0D312 on Thu Aug 11, 2011 7:19 pm

In your user file settings add:
Code: Select all
"shift_tab_unindent": true


or set "shift_tab_unindent" to true in your default file settings.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Unindent using shift-tab

Postby 16bytes on Thu Aug 11, 2011 7:51 pm

In your user file settings add: "shift_tab_unindent": true


Hmmm... tried that in both the global default and user files and that didn't work. Why wouldn't that be turned on by default anyway?
16bytes
 
Posts: 6
Joined: Thu Aug 11, 2011 7:01 pm

Re: Unindent using shift-tab

Postby adzenith on Thu Aug 11, 2011 11:51 pm

By default you have to have a new-line in your selection in order for shift-tab to unindent. This option makes it so that the unindenting happens regardless of whether there's a new-line in the selection.
adzenith
 
Posts: 1216
Joined: Mon Oct 19, 2009 9:12 pm

Re: Unindent using shift-tab

Postby 16bytes on Fri Aug 12, 2011 1:34 pm

By default you have to have a new-line in your selection in order for shift-tab to unindent


I'm not sure that that is a sensible default. Under Edit->Line, Unindent = Shift-Tab. Why should it be context specific (i.e. when there is a new-line in the selection)? If there's no other function for shift-tab, then disabling it in certain circumstances is counter-intuitive. If I want to unindent a line I would have to hit ctrl-l to select the whole line, then shift-tab to unindent. It's a whole other key-chord that is unnecessary.

It also violates the law of least surprise. I can't think of another "smart" editor where shift-tab doesn't always unindent (no matter where you are in a line).

Besides, setting that option didn't seem to work. Is there anything else I can try?
16bytes
 
Posts: 6
Joined: Thu Aug 11, 2011 7:01 pm

Re: Unindent using shift-tab

Postby iamntz on Fri Aug 12, 2011 2:49 pm

It also violates the law of least surprise. I can't think of another "smart" editor where shift-tab doesn't always unindent (no matter where you are in a line).

Coda? Dreamweaver? And i think Textmate too :)

Actually, this behavior is for jumping to previous snippet cursor position (when it need). I think is a reminiscence of the past, because now works ok.
iamntz
 
Posts: 910
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Unindent using shift-tab

Postby 16bytes on Fri Aug 12, 2011 5:31 pm

Coda? Dreamweaver? And i think Textmate too


Good points; I haven't used those much. Not sure if this is a windows vs. mac os convention. Notepad++, Eclipse, and Visual Studio will all unindent with shift-tab at the beginning of a line

Actually, this behavior is for jumping to previous snippet cursor position (when it need)


I can understand having shift-tab differ depending on context (such as filling in snippet fields), but in plain default mode, I don't think it makes sense to turn off shift-tab=unindent. Why would you want shift-tab to act the same as tab, especially when the unindent command is listed as being bound to shift-tab in the menu?

Is that not a bug, especially when setting
Code: Select all
"shift_tab_unindent": true

doesn't work?
16bytes
 
Posts: 6
Joined: Thu Aug 11, 2011 7:01 pm

Re: Unindent using shift-tab

Postby iamntz on Sat Aug 13, 2011 5:23 am

if that doesn't work you can add this in your shortcut file and should work:
Code: Select all
{ "keys": ["shift+tab"], "command": "unindent" },
{ "keys": ["shift+tab"], "command": "prev_field", "context":[
{ "key": "has_prev_field", "operator": "equal", "operand": true }
]}
iamntz
 
Posts: 910
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Unindent using shift-tab

Postby 16bytes on Mon Aug 15, 2011 1:48 pm

Thanks iamntz, that does indeed work. Is there a link for the 2.0 documentation of the key-binding and settings JSON?
16bytes
 
Posts: 6
Joined: Thu Aug 11, 2011 7:01 pm

Re: Unindent using shift-tab

Postby christoz on Mon Aug 22, 2011 10:01 am

where is the "shortcut file"?
thank you
christoz
 
Posts: 2
Joined: Mon Aug 22, 2011 9:33 am

Next

Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests