Sublime Forum

Set VISUAL width of indentation spaces

#1

Hi, I’m in a large joint code project with way to many people with oppinions about tabs vs. spaces.

As a designer I like to have som space… VISUAL indentation space that is.

In the project I’m in, they use 2 spaces as indentation, not tabs - two is just not enough for my OCD to stay calm :smiley:

So what I’m searching for is something that already is possible in VS Code via an extension: https://marketplace.visualstudio.com/items?itemName=kylepaulsen.stretchy-spaces

Here you can define how many spaces one space should behave like. So if code is 2 spaces for indentation, it will VISUALLY show as 4 spaces wide.

0 Likes

#2

Interesting feature. It is a strong defensive shield for the everlasting tab vs spaces fight!

0 Likes

#3

Spaces are spaces and tabs are tabs; spaces are specific things and tabs are variable width. As such there’s nothing in the core that provides such functionality; the core displays exactly the content as it appears in the file and doesn’t allow the display to fundamentally differ from that structure.

Thus what you would need is a plugin that physically modifies files when you load them from disk and then modifies them back again when you save. I’m not aware of such a thing that exists for Sublime currently, although it’s theoretically possible to achieve it to some degree, at the expense of breaking some features (e.g. incremental diff).

0 Likes