How do I auto-indent an entire project?

Answered

I'm coming to a legacy Java project that was indented using tabs (*cringe*).  I would like to use IntelliJ to auto-indent all the Java files in the project.  However, I can't figure out how to do this for the entire project at once.  Is it possible?

3 comments
Comment actions Permalink

Hi Jared,

It's not possible to do that at the moment. The only option is to perform complete reformat - right click on the target node at project view and call 'reformat code' from the context menu. That will recursively process all files below that node.

Denis

0
Comment actions Permalink

This is a very old thread, I know, but maybe someone could chime in from JB and tell us how to reformat code recursively within a folder. The technique described by Denis doesn't seem to be valid anymore - no such option in the right-click menu (Mac).

0
Comment actions Permalink

Old but someone might stumble on this.

Select the folder you want to reformat and click on the Code Menu in the Menu bar. There you will find the Reformat Code option.

2

Please sign in to leave a comment.