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

Web DevProductivity

Keeping on top of website updates

Learn what website updates are, what they entail, why they are important, and how we can help

Freelancing

Getting the most out of your agency

Here are some tips based on years of working with, for, and as an agency on how to get the most out of any work you do.