Will Sewell
Will Sewell

Reputation: 2643

Convert Tabs-as-spaces width

I have many source code files which are idented with 8 space characters, I want to convert these to 4 character indents. What is the best way of doing this? A technique using eclipse would be preferable.

Upvotes: 0

Views: 749

Answers (1)

E-Riz
E-Riz

Reputation: 32914

Select the project(s), then press Ctrl+H to open the Search dialog (or click the Search > File menu).

  • Make sure the File Search tab is selected at the top.
  • Enter 8 spaces into the Containing text: field
  • Select your File name pattern (probably *.java or just *)
  • Select the scope (probably Selected Resources)
  • Press the *Replace... button.

As I said in the comments above, however, using spaces for indentation is a fool's game; tabs are the proper abstraction for indentation so that you don't have this problem.

Upvotes: 1

Related Questions