- Press Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter to add a new line after the one where the
caret is currently located and move the caret to the beginning of this new line.
For instance, you have typed some text:

Press Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter to start the next line immediately:

- Place the caret at the line to be duplicated, or select the desired fragment of text.
- Press Ctrl+DCtrl+DCtrl+DCtrl+DMeta+DCtrl+DCtrl+D, Ctrl+Shift+Down or Ctrl+Shift+UpCtrl+DMeta DMeta DMeta D.
- Press Ctrl+YCtrl+YCtrl+YCtrl+YCtrl+YCtrl+Shift+LCtrl+ECtrl+DMeta YMeta YMeta D to delete the line at caret.
- Place the caret at the line to be moved.
- Do one of the following:
- On the main menu, choose or .
- Press Alt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt+Shift+UpAlt Shift UpAlt Shift UpAlt Shift Up or Alt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt+Shift+DownAlt Shift DownAlt Shift DownAlt Shift Down.
PhpStorm moves the selected line one line up or down, performing the syntax check. For example:

After moving line at caret:

- Select a statement to be moved, or just place the caret at the first or last lines of a multi-line statement. Note that if moving a statement is not allowed in the current context, the commands will be disabled.
- Do one of the following:
- On the main menu, choose .
- Press Ctrl+Shift+UpCtrl+Shift+UpCtrl+Shift+UpCtrl+Shift+UpCtrl+Shift+UpCtrl+Shift+UpAlt+Shift+UpAlt+UpMeta Shift UpMeta Shift UpAlt Up or Ctrl+Shift+DownCtrl+Shift+DownCtrl+Shift+DownCtrl+Shift+DownCtrl+Shift+DownCtrl+Shift+DownAlt+Shift+DownAlt+DownMeta Shift DownMeta Shift DownAlt Down.
Note
If you apply the same commands to a line at caret, or a to a selection, it will be moved one line up or down.
PhpStorm moves the selected statement above the previous one, or directly underneath the next one, performing the syntax check. For example, place the caret at the method declaration:

After moving the statement:

Tip
Make sure that keyboard shortcuts are not in conflict. You can do that in the Keymap page of the IDE Settings.

