Here is a handy vscode shortcut key to move the current line up or down. There is no need to select the line; your cursor should be on the line you want to move up or down.
To Move the current line down
Alt + Down
Similarly, to move a line upwards.
To move the line up
Alt + Up
To undo your moves if required, press Ctrl + Z
To summarize, we have covered the steps for using visual studio code keyboard shortcuts to move lines up or down. This is tested in the Windows 11 version of VScode. This convenient vscode shortcut key will up or down the current line. Your cursor should be on the line you want to move up or down; there is no need to select it.