Sublime Forum

Remove tab-character (\t) on shift+tab (ST2)

#1

ST2 is a great editor, in my opinion it’s better than Kate, GEdit, Geany and even better than big players like Komodo Edit.

But there is one small thing I miss from other editors (especially Komodo Edit) I would love to see in my Sublime Text.
With the Tab-key I can insert tabs (character \t) (well, that’s no big surprise). Sometimes I accidentally insert to many tabs.
In this case I have to remove the single spaces (“indent using spaces” is activated) with backspace. That’s not really comfortable.

In Komodo Edit I can use shift+tab to remove one tab-character, so I can quickly and comfortable correct my misstake. In ST2 I can only unindent the whole line with this key-binding.

Does anybody know a plugin, key-binding, workaround or something to teach my sublime this behaviour?

0 Likes

Back-tab is brain dead when translate_tabs_to_spaces is true
#2

If multiple spaces are being inserted then no tab characters are being inserted (\t). You can check this is true if in your preferences you have translate_tabs_to_spaces set to true. If it is set to true then set use_tab_stops to true as well and when you press backspace you will delete up to the last tab-stop.

0 Likes

#3

But then I can’t tab to a specific point / width and then go back one single space. I would have to make less \t-characters / remove one \t and then insert the remaining spaces.

Is it possible to remove one space using backspace but delete up to the previous tab-stop with another key-binding?

Edit:
I just noticed, that tab-stops only work for the beginning of a line.

Example:

$a    = 1;
$abcd = 2;

If I use tab to indent the “=”-characters to the same column, there is no tab-stop in front of the “=”.

0 Likes

#4

[quote=“Exterior”]But then I can’t tab to a specific point / width and then go back one single space. I would have to make less \t-characters / remove one \t and then insert the remaining spaces.

Is it possible to remove one space using backspace but delete up to the previous tab-stop with another key-binding?

Edit:
I just noticed, that tab-stops only work for the beginning of a line.

Example:

$a    = 1;
$abcd = 2;

If I use tab to indent the “=”-characters to the same column, there is no tab-stop in front of the “=”.[/quote]

use the plugin **alignment **then you don’t have to insert spaces yourself.

0 Likes

#5

This plugin is pretty cool and I will give it a try.

But that’s actual not what I’m looking for. With this, I have to write my code “quick 'n dirty” and after that I have to look through the code and give it some nice formatting. But I want this feature because I want the code clearly while coding, not after the work is done :wink:

Is there really no way to go one tab-stop back ore something on shift+tab inside of a line (not at the beginnig of the line)?

0 Likes