I know how to do it on Mac, Linux and Windows, but it doesn't work on Chromebook. You'd expect it to be alt-up/down like Win/Linux, but that is treated like home and end.
Anybody know the trick?
If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up. If you use the Alt+Down Arrow keys, the line of code selected moves down.
Alt + Up/Down and Ctrl + Alt + Up/Down are reserved by Chromebook. You could open File --> Preferences --> Keyboard Shorcuts in VS Code and change Move Line Up/Down settings to something else.
In a Gmail email, Google Doc, etc., enter moves you to a new line. In other sites or apps, it may be alt-enter, ctrl-enter, shift-enter, or another key sequence.
To move a line down use ⌥⇧↓ (macOS), or Alt+Shift+Down Arrow (Windows/Linux).
Alt + Up/Down and Ctrl + Alt + Up/Down are reserved by Chromebook. You could open File --> Preferences --> Keyboard Shorcuts in VS Code and change Move Line Up/Down settings to something else.
Chromebook keyboard shortcuts
Chromebook keyboard shortcuts image
There's a easy way.
Just open google-chrome and type chrome://flags in the URL bar,go to the Experiments page.
Search Deprecate Alt based six-pack , then Enable this feature.
Restart.
Then you can use the default shortcut to move line up/down in VSCode.
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