我想删除一行就像按Ctrl + X没有选择任何东西,但不保存到复制堆栈。这可能吗?
我使用Visual Studio 2010。
我想删除一行就像按Ctrl + X没有选择任何东西,但不保存到复制堆栈。这可能吗?
我使用Visual Studio 2010。
当前回答
更正我的回答
Ubuntu 16 & Visual studio版本:1.30.1
切线 Shift + del
删除Shift + Ctrl + k行
其他回答
Ctrl + Shift + L将删除该行,而不复制到剪贴板。
编辑。LineDelete是命令的名称。默认情况下,它被绑定到Ctrl + Shift + L,但你可以给它任何你喜欢的工具|选项|键盘。
编辑:修正的默认快捷方式信息。
2022年VS Code的有效答案(附图)
以上所有关于Ctrl + Shift + L的答案现在都已弃用。
正确的默认行为是Ctrl + Shift + K (如果你是MAC用户,⌘+ Shift + K)。
更改此默认行为:
1-去文件>首选项>键盘快捷键(或点击Ctr+K Ctrl+S)
2-在搜索栏中输入删除行
在这里你会发现相应的行为。你可以通过双击它并按键盘上任何想要的键组合来更改它(注意冲突的快捷键)。
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.
在mac上默认是Cmd + Shift + K。
但可以根据用户需要从设置中修改(首选项->键盘快捷键)->搜索删除线路键值。