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

SEO

Google follows URLs in text

Today I learned that Google follows URLs even when they are plain text

Web Dev

Check in with your database

It pays to take a step back and look at how your database is set up every so often. You will often find quick wins and hidden tech debt.