Editor "On Save" option: "Convert Tabs to Spaces" ?

Answered

How about the following editor "On Save" option: "Convert Tabs to Spaces" ?
When not everybody is using spaces instead of tabs (go talk to them ..) we need to manually convert their tabs to spaces. If IDEA was doing that automatically - that would be way more comfortable !

8 comments
Comment actions Permalink

It's trivial to convert them in IDEA. Summon a Global Replace via Ctrl-Shift-R, check Regular Expressions on, \t for search, 4 spaces for replace, go. Better than opening every file :)

0
Comment actions Permalink

No, I didn't mean to make a replacement in every file, only in the one being saved right now. Same way as IDEA strips trailing spaces: Settings -> IDEA Settings -> Editor -> Strip trailing spaces on Save. That's where I suggest to add a checkbox "Convert Tabs to spaces on Save" if "Global Code Style" (Settings -> IDEA Settings) has "Use tab character" unchecked, i.e if user is not using Tabs.

0
Comment actions Permalink

But I liked your idea about global replacement in one go for the whole project ..

0
Comment actions Permalink

I like this idea...

N.

Evgeny Goldin wrote:

No, I didn't mean to make a replacement in every file, only in
the one being saved right now. Same way as IDEA strips trailing
spaces: Settings -> IDEA Settings -> Editor -> Strip trailing spaces
on Save. That's where I suggest to add a checkbox "Convert Tabs to
spaces on Save" if "Global Code Style" (Settings -> IDEA Settings)
has "Use tab character" unchecked, i.e if user is not using Tabs.

0
Comment actions Permalink

It would be cool, if it were not out of desperate necessity. Those people are 'untalkable'...

0
Comment actions Permalink

Yeah, I understand what you mean ..

0
Comment actions Permalink

That's because there's nothing to talk about.  People who use spaces for indentation are "Of The Devil" and must be purged of their sinful ways!  ;)

In any case, I agree, this would be a very simple and beneficial addition to IntelliJ IDEA.  

0

Please sign in to leave a comment.