Using Webstorm8, I have been unable to figure out when using move line up or down, it will not place the line inside of a function, rather it skips the function either placing the movable line at the top or bottom of the function based on direction of line movement. Any ideas how to move a line up or down a line number as happens in Sublime?
Move a line up or down Choose Code | Move Line Up/Down from the main menu. Press Alt+Shift+Up or Alt+Shift+Down .
Press the shortcut keys to move the line under the cursor up or down or select a block of text and press the shortcut keys to move the entire block up or down. The default shortcut keys are as follows: Alt + ↑ (Up Arrow) – Moves a line up. Alt + ↓ (Down Arrow) – Moves a line down.
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.
You can move the line where the caret resides up and down using dedicated shortcuts: Ctrl+Alt+Shift+Up and Ctrl+Alt+Shift+Down .
For line up cmd+Shift+up
For line down cmd+Shift+down
Just to clarify if anyone else runs into this... The shortcut of alt up/down is set to 'move statement' by default.
goto File > Settings... Type Keymap in the lefthand search to find the left nav option of 'keymap'
then in the right hand search search 'move line' and scroll down to switch it as shown in the picture below...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With