0

I am using eclipse IDE for development I have written some code in if-else block and now I want to tab indent every block, Is there any way or command or key sequence so that I can select the lines of code and simply add tab space in front of every line selected.

Alex K.
  • 3,294
  • 4
  • 29
  • 41
DCoder
  • 3,486
  • 7
  • 36
  • 68

2 Answers2

1

Use the formatter for this. Right click your file and select Source -> Format. You can also execute this for a single code block. Just select the block and right click -> Source -> Format. You can also format Javadoc this way.

If you don't like the way your code gets formatted you can change the formatter template in Windows -> Preferences -> Java -> Code -> Formatter.

Kai
  • 38,985
  • 14
  • 88
  • 103
0

Select the block(or set of statements) and just press TAB to indent. The whole selected block(or set of statements) will be moved.

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68