How do I duplicate a line or selection within Visual Studio Code?

前端 未结 17 2337
青春惊慌失措
青春惊慌失措 2020-12-04 04:38

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

17条回答
  •  再見小時候
    2020-12-04 04:55

    For Fedora 29 workstation (Gnome 3.30.2) and Ubuntu users.

    Unbind unnecessary left/right workspace keyboard combinations, list them by terminal

    $ gsettings list-recursively | grep -E "org.gnome.desktop.wm.keybindings move-to-workspace-|org.gnome.desktop.wm.keybindings switch-to-workspace-"
    

    Unbind them

    $ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "[]"
    $ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "[]"
    $ gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-left "[]"
    $ gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-right "[]"
    

    Reset duplicate shortcuts

    • Super+Pgdown/PgUp , Ctrl+Alt+DownArrow/UpArrow
    • Super+Shift+PgDown/PgUp , Ctrl+Alt+Shift+DownArrow/UpArrow

    They can be easily reset to work with only one shortcut in Settings>Devices>Keyboard
    Only type again Super+PgUp for "Move to workspace above" as an example.

    Now with less duplicate shortcuts in fedora29 all vscode shortcuts for linux must work fine

提交回复
热议问题