Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut for moving a block of code over 4 indents in IntelliJ IDEA

Does anyone know the shortcut for shifting a block of code in IntelliJ over by a few indents?

(For the CSS editor, Coda, I used to select the block or blocks of code and use the shift and left or right carrot symbols to shift the code right or left.)

like image 384
Chapsterj Avatar asked Jun 25 '12 16:06

Chapsterj


People also ask

How do I move a block of code in IntelliJ?

To move (swap) a code element to the left or to the right, place the caret at it, or select it and press Ctrl+Alt+Shift+Left for left or Ctrl+Alt+Shift+Right for right.

How do I move an indent in IntelliJ?

Reformat line indents You can reformat line indents based on the specified settings. While in the editor, select the necessary code fragment and press Ctrl+Alt+I . If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style.

How do I move multiple lines one space to the right in IntelliJ?

Source menu -> Click "Shift Left" or "Shift Right"

How do I move multiple lines in IntelliJ?

Moving Content Up or Down in Your Class With your caret on a line, you can press ⌥⇧↑ (macOS), or Alt+Shift+Up Arrow (Windows/Linux), to move a line up. Alternatively, you can move a line down with ⌥⇧↓ (macOS), or Alt+Shift+Down Arrow (Windows/Linux). The same shortcut can move a selection up or down.


1 Answers

These are common Indent and Unindent actions, default shortcuts: Tab and Shift+Tab.

like image 84
CrazyCoder Avatar answered Sep 22 '22 04:09

CrazyCoder