Home Download Buy Blog Forum Support

V2 - Rollback shift + tab to unindent?

V2 - Rollback shift + tab to unindent?

Postby neojp on Thu Apr 28, 2011 9:21 pm

Good afternoon,

I was wondering if is there a way to disable "Shift + Tab" to insert a regular tab, and rollback the functionality to use unindent. I'm so used to this key shortcut, that it's getting in my nerves.

Thanks!

PS. I love Sublime Text 2, look forward to the final version!
neojp
 
Posts: 1
Joined: Thu Apr 28, 2011 9:16 pm

Re: V2 - Rollback shift + tab to unindent?

Postby ratnushock on Sun May 01, 2011 10:27 pm

This is actually a bug related to tab_completion.
Hope John fixes it soon I also use this a lot and it's frustrating.
ratnushock
 
Posts: 8
Joined: Sun May 01, 2011 10:08 pm

Re: V2 - Rollback shift + tab to unindent?

Postby iamntz on Mon May 02, 2011 10:25 am

I did it this way: Preferences->User Key Bindings-> i added this:

Code: Select all
{ "keys": ["shift+tab"], "command": "unindent" }


Work like a charm. I didn't discovered any conflicts by now.
iamntz
 
Posts: 816
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: V2 - Rollback shift + tab to unindent?

Postby ratnushock on Mon May 02, 2011 11:28 am

iamntz wrote:I did it this way: Preferences->User Key Bindings-> i added this:

Code: Select all
{ "keys": ["shift+tab"], "command": "unindent" }


Work like a charm. I didn't discovered any conflicts by now.


That's already on the the Default Key Bindings file, but it needs a context which doesn't seem to work properly because of tab_completion.

Lines 140 ~ 150:
Code: Select all
...

{ "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },
{ "keys": ["shift+tab"], "command": "unindent", "context":
    [
        { "key": "text", "operator": "regex_contains", "operand": "\n" }
    ]
},
{ "keys": ["shift+tab"], "command": "prev_field", "context":
    [
        { "key": "has_prev_field", "operator": "equal", "operand": true }
    ]
},

...


Anyway, I tried yours and seems to work nice, so thanks for your solution.
ratnushock
 
Posts: 8
Joined: Sun May 01, 2011 10:08 pm

Re: V2 - Rollback shift + tab to unindent?

Postby bizoo on Mon May 02, 2011 11:55 am

Don't understand the problem here, or maybe it's a something related to the OS (I'm on windows).

The context { "key": "text", "operator": "regex_contains", "operand": "\n" } mean that you need a "carriage return" in the selection to trigger the unindent.
So if you want to unindent only the current line you have to press CTRL+L to select all the line and after SHIFT+TAB to unindent.
This is how ST1 work and feel right to me.

I tried some other editors (pspad, wordpad, Delphi, ...) and my conclusion is that this behavior is common to all.
If you don't select your text before un/indenting, there's no standard behavior and it depend of your editor.
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: V2 - Rollback shift + tab to unindent?

Postby guillermooo on Mon May 02, 2011 12:22 pm

I realize it's a matter of habit, but I agree with bizoo that the symmetry between Tab and Shift+Tab in selected whole lines is pretty clear.

Maybe Shift+Tab could be made to unindent if the previous character was a tab (or the beginning of the line), or do its current thing if it wasn't. A tab character as a tab trigger wouldn't make too much sense, would it?
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: V2 - Rollback shift + tab to unindent?

Postby oats on Wed May 11, 2011 9:15 pm

Shift-tab should always be unindent. Period.

I hope this changes with the next ST release.
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm

Re: V2 - Rollback shift + tab to unindent?

Postby bizoo on Thu May 12, 2011 5:55 am

oats wrote:Shift-tab should always be unindent. Period.

I hope this changes with the next ST release.

Like I already said, ST1 don't work like this so it looks that this behavior was only present in the beginning of the alpha of ST2. I didn't notice it myself.
So if you want it, do it yourself http://www.sublimetext.com/forum/viewtopic.php?f=3&t=2059#p9525
Last edited by bizoo on Thu May 12, 2011 6:32 am, edited 1 time in total.
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: V2 - Rollback shift + tab to unindent?

Postby elmer on Thu May 12, 2011 6:08 am

It's great pain in the ass for me. For now I decided to downgrade to Alpha Build 2056 - last version I found without this bug (feature??).
elmer
 
Posts: 9
Joined: Wed Dec 29, 2010 7:58 am

Re: V2 - Rollback shift + tab to unindent?

Postby oats on Thu May 12, 2011 12:34 pm

What ST1 did is irrelevant. The best default behavior for Shift-tab is unindent. I think that makes the most sense for most people. Key bindings are always available for those who want something different.
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm

Next

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 20 guests