272

It's so easy to select a block of code and tab out, but how about the reverse?

Currently, I just search and replace for white space at the beginning of the line. Is there anything faster?

11 Answers 11

576

In Visual Studio and most other half decent IDEs you can simply do SHIFT+TAB. It does the opposite of just TAB.

I would think and hope that the IDEs you mention support this as well.

13
  • 4
    Xcode is slightly different, uses COMMAND-[ and COMMAND-] Nov 24, 2014 at 16:45
  • 8
    For any future folks who end up here via a Google search, this also works in Github's Atom IDE.
    – jbgarr
    May 8, 2015 at 18:24
  • 2
    Fine also in IntelliJ Oct 1, 2016 at 21:04
  • 5
    SHIFT+TAB works for Android Studio as well. Thanks !
    – Red M
    Oct 23, 2016 at 20:23
  • 4
    Works in VSCode
    – JP Zhang
    Apr 7, 2019 at 13:13
23

Shift-tab outdents again :)

The standard shortcut keys are covered in Standard Accelerators.

You'll find many of the more esoteric ones on FAQ What editor keyboard shortcuts are available?.

0
13

Here is a general answer for untab:

In Python IDLE: Ctrl + [

In Eclipse: Shift + Tab

In Visual Studio: Shift + Tab

1
8

In general, Shift + Tab works for any environment.

0
6

This workaround works most of the time. It uses Eclipse's 'smart insert' features instead:

  1. Control + X to erase the selected block of text, and keep it for pasting.
  2. Control + Shift + Enter, to open a new line for editing above the one you are at.
  3. You might want to adjust the tabbing position at this point. This is where tabbing will start, unless you are at the beginning of the line.
  4. Control + V to paste back the buffer.

I hope this helps until Shift + TAB is implemented in Eclipse.

0
5

Shift + Tab does that in Flex Builder (based on Eclipse), so it hopefully should work in regular Eclipse :)

5

In PyCharm, just use Shift + Tab to move a block of code left.

4

Yes, in PyCharm: Shift + Tab works fine.

1
3

Yes, You can do this in VS Code & Same works in most of IDE with the help of Shift + Tab.

Process :

a) Select the code you want to take one tab back. b) Press SHIFT + TAB

2

You can do this by going to the Window menu → Preferences, and then open the General list. Choose Keys.

Scroll down the list of keys until you see "Shift Left". Click that. Below that, you'll see some boxes, one of which lets you bind a key. It won't accept Shift + Tab, so I bound it to Shift + `. Apply Apply and Close, and you're all set.

0

You can also change the shortcut. Use the Command + K, Command + S shortcuts to open the Keyboard Shortcut menu. Search for the "tab" and find the "outdent" in the list.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.