Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 327
Ripon Al Wasim Avatar asked Nov 26 '25 03:11

Ripon Al Wasim


1 Answers

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).

like image 99
reto Avatar answered Nov 27 '25 17:11

reto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!