Carmageddon
Carmageddon

Reputation: 2829

How to force IntelliJ IDEA to convert all java files from spaces to tabs?

I have an existing project, where some of the java files have tabs, some have spaces for indentation. I want to make ALL java files based on tabs, but there are hundreds of them, the action of "to tabs" is not realistic I am not going to go manually over multiple modules, hundreds of files!

Is there any other way to do it smartly without going through individual files?

Upvotes: 1

Views: 1286

Answers (1)

Ersoy
Ersoy

Reputation: 9596

Here are the steps to follow.

  • Settings > Editor > Code Style > Java
  • Tabs and Indents > Click [Use tab character]
  • Go to tree structure/Project window (the main side tab of project hierarchy display)
  • Right click the folder(or project) you want to convert and select Reformat code & Run

Upvotes: 2

Related Questions