Sublime Forum

Unindent no longer works?

#1

I was editing a file and when I pressed shift+tab, nothing happened.

I looked in my keymap file and found:

<binding key="shift+tab" command="noop"/> <binding key="shift+tab" command="unindent"> <context name="newlineInSelection" value="true"/> </binding> <binding key="shift+tab" command="prevField"> <context name="hasPrevField" value="true"/> </binding>

I tried commenting out the noop block, but that just made shift+tab act like regular tab.

Can anyone point me in the right direction?

0 Likes

#2

I made a macro which selects the line I like to unindent and bind the call to shift+tab like this:

<binding key="shift+tab" command="runMacroFileSilently 'Packages/User/unindentLine.sublime-macro'"/>

The macro is recorded and works for me.

move lines 1
move lines -1
expandSelectionTo line
unindent
moveTo bol
0 Likes

#3

It turned out it was working, just not the way I was expecting.

Turns out you can’t unindent just one line, due to the tag, you have to select multiple lines.

I simply changed my bindings to:

<binding key="shift+tab" command="unindent" />
<binding key="shift+tab" command="prevField">
        <context name="hasPrevField" value="true"/>
</binding>

to get the behavior I wanted.

I love the customizability (is that a word?) of this program :smile:

0 Likes

#4

What a simple solution :smiley:

0 Likes

#5

[quote=“samkerr”]Turns out you can’t unindent just one line, due to the tag, you have to select multiple lines.
I simply changed my bindings to:

<binding key="shift+tab" command="unindent" />
<binding key="shift+tab" command="prevField">
        <context name="hasPrevField" value="true"/>
</binding>

to get the behavior I wanted.[/quote]

Thank you for this tip! Solved a confusing inconvenience for me. My preference is that this should be the default…

0 Likes