Move a line up or down with VS Code

A quick tip on moving lines up or down a file using your keyboard in VS Code

You can rearrange the order of lines in your VS Code file by using the keyboard. This can be really handy if you want to manually re-order a list or hard-coded array.

Hold down Option / Alt and use the Up or Down arrow keys to move the currently selected line up or down.

You can also select multiple lines in VS Code and move them all at once.

This is something you won’t need every day, but is much faster than cutting and pasting when you do need it.

Recent posts View all

EmailStudents

Unsolicited Hiring Tips

If you're going to email a company out of the blue, help them to help you with these three tips

Reviews

Review: How data happened

A fun read for anyone interested in data or the social history around it