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 be
You can find keyboard shortcuts from
File > Preferences > Keyboard Shortcuts
Default Keyboard Shortcuts are,
Copy Lines Down Action : shift+alt+down
Copy Lines Up Action : shift+alt+up
Move Lines Up Action : alt+up
Move Lines Down Action : alt+down
Or you can override the keyboard shortcuts from
File > Preferences > Keyboard Shortcuts
And editing the keybindings.json
Example:
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+up",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
}
]