Ripon Al Wasim
Ripon Al Wasim

Reputation: 37806

How to indent/shift a line of code or a block of code in IntelliJ IDEA

I can shift a line of code or a block of code in Eclipse by the following way:

  1. Focus a line or select a block of source code
  2. Source menu -> Click "Shift Left" or "Shift Right"

How to do the same thing in IntelliJ IDEA?

Upvotes: 18

Views: 41215

Answers (1)

reto
reto

Reputation: 10463

Assuming we use "shift" and "indent" as synonyms:

  • [Tab] (to move things further to the right)
  • [Shift] + [Tab] (to move things further left)

It will do (almost) the same in Eclipse and IntelliJ.

For the commands above we assume that you selected at least one character, if you just place your cursor somewhere the [tab] key will obviously just insert a tab (or some spaces, depending on your config).

Upvotes: 48

Related Questions