Posted By: Anonymous
Using Microsoft’s Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Similar to Sublime’s cmd+shift+d behaviour)
It’s a feature that I use constantly, and am struggling using Visual Studio Code without it.
The commands your are looking for are
You can see the associated keybindings by picking: File > Preferences > Keyboard Shortcuts
Shift+Alt+Down and Shift+Alt+Up
Shift+Option+Down and Shift+OptionUp
Ctrl+Shift+Alt+Down and Ctrl+Shift+Alt+Up
(Might need to use numpad Down and Up for Linux)
editor.action.moveLinesDownAction are the ones to move lines and they are bound to Alt+Down and Alt+Up on Windows and Mac and Ctrl+Down and Ctrl+Up on Linux.