我想删除一行就像按Ctrl + X没有选择任何东西,但不保存到复制堆栈。这可能吗?
我使用Visual Studio 2010。
我想删除一行就像按Ctrl + X没有选择任何东西,但不保存到复制堆栈。这可能吗?
我使用Visual Studio 2010。
编辑。LineDelete是命令的名称。默认情况下,它被绑定到Ctrl + Shift + L,但你可以给它任何你喜欢的工具|选项|键盘。
编辑:修正的默认快捷方式信息。
我将Ctrl + L(全局)映射到Edit.LineDelete。否则,快捷键是Ctrl + Shift + L,这很尴尬。进入工具>选项>环境>键盘,如下图所示。
所有的答案都很有用,但似乎对我不起作用。
所以我找到了解决方案——> Visual Studio 2017(当然还有2019):
工具>选项>环境>右边面板的键盘>选择Edit.LineEdit。
下面有一个组合框使用新的快捷方式在:与全局写——>更改为文本编辑器。
在右边有一个文本输入按快捷键:,所以使用你选择的快捷键。
然后点击右边的Assign PushButton(否则它将不会被应用)。
终于>好了。
现在可以打开. cpp文件并使用快捷方式删除一行。
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
默认情况下,如果您正在使用c#默认配置文件,您可以使用Ctrl + Shift + L删除一行。
您可以使用Tools-> customize自定义。选择“键盘”。查找Edit命令。LineDelete将它分配给你喜欢的任何键盘快捷键。 源
如果你在这里寻找Visual Studio Code的答案,默认的快捷方式是:
ctrl + shift + K for Windows
为MacOS⌘+ shift + K
但是,您可以更改文件>首选项>键盘快捷方式
{
"key": "ctrl+shift+delete",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
}
源
2022年VS Code的有效答案(附图)
以上所有关于Ctrl + Shift + L的答案现在都已弃用。
正确的默认行为是Ctrl + Shift + K (如果你是MAC用户,⌘+ Shift + K)。
更改此默认行为:
1-去文件>首选项>键盘快捷键(或点击Ctr+K Ctrl+S)
2-在搜索栏中输入删除行
在这里你会发现相应的行为。你可以通过双击它并按键盘上任何想要的键组合来更改它(注意冲突的快捷键)。