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

我使用Visual Studio 2010。


当前回答

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

其他回答

在mac上默认是Cmd + Shift + K。

但可以根据用户需要从设置中修改(首选项->键盘快捷键)->搜索删除线路键值。

更正我的回答

Ubuntu 16 & Visual studio版本:1.30.1

切线 Shift + del

删除Shift + Ctrl + k行

上面的答案对我都没用。在visual studio代码中删除一行使用:shift+del

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.

我将Ctrl + L(全局)映射到Edit.LineDelete。否则,快捷键是Ctrl + Shift + L,这很尴尬。进入工具>选项>环境>键盘,如下图所示。