我想删除一行就像按Ctrl + X没有选择任何东西,但不保存到复制堆栈。这可能吗?

我使用Visual Studio 2010。


当前回答

在Visual Studio 2019 for Mac上,默认情况下按CTRL + K剪切整行。

其他回答

CTRL + L (Visual Studio 2019 Windows)

Ctrl + Shift + L将删除该行,而不复制到剪贴板。

编辑。LineDelete是命令的名称。默认情况下,它被绑定到Ctrl + Shift + L,但你可以给它任何你喜欢的工具|选项|键盘。

编辑:修正的默认快捷方式信息。

The other answers are specific to Visual Studio, which is what was requested by OP, however if anyone is looking for a more generalized way to do this for most Windows programs, you can also Triple-Click to select any block of text, then just press the Delete key. This works for any Windows text editors or TextBoxes, including password boxes, search boxes, browser web address boxes, etc. For text editors such as Visual Studio, a block of text is typically one line of code. Obviously you can do other things too, such as triple-click to select a line of code, then Ctrl-X, Ctrl-V to cut/paste, etc, or just triple-click and type over it to replace a line.

下面是windows键盘快捷键参考的url: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

windows: Ctrl + Shift + k