且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio Code 中复制行或选择?

更新时间:2023-02-18 15:06:17

您正在寻找的命令是 editor.action.copyLinesDownActioneditor.action.copyLinesUpAction.

The commands your are looking for are editor.action.copyLinesDownAction and editor.action.copyLinesUpAction.

您可以通过选择来查看关联的键绑定:文件 > 首选项 > 键盘快捷键

You can see the associated keybindings by picking: File > Preferences > Keyboard Shortcuts

Windows:

Shift+Alt+DownShift+Alt+向上

苹果机:

Shift+Option+DownShift+Option向上

Linux:

Ctrl+Shift+Alt+向下Ctrl+Shift+Alt+向上

(Linux 可能需要使用 numpad DownUp)

(Might need to use numpad Down and Up for Linux)

此外,命令 editor.action.moveLinesUpActioneditor.action.moveLinesDownAction 是用于移动行的命令,它们绑定到 Alt+DownAlt+Up(在 Windows 和 Mac 上)和 Ctrl+DownCtrl+Up 在 Linux 上.

Furthermore, commands editor.action.moveLinesUpAction and 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.