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

前端 未结 17 2393
青春惊慌失措
青春惊慌失措 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:49

    For Windows :

    To Copy Up - shift+alt+up

    To Copy Down - shift+alt+down

    For mac :

    To Copy Up - shift+option+up

    To Copy Down - shift+option+down

    For linux :

    To Copy Up - ctrl+shift+alt+8

    To Copy Down - ctrl+shift+alt+2

    Note : You may change your keyboard shortcuts keybinding for visual studio code by pressing ctrl+shift+p, then type open keyboard shortcut in the pallet and then hit enter so new file will be opened (Key board shortcut file) you can see all the shortcuts over their and can change keybindings by clicking twice over the respective keybinding and then by entering your own keybinding, finally hit enter.

    Hope this will help somebody!

提交回复
热议问题