Visual Studio编辑器-将选择范围扩展到下一个更大的代码块? [英] Visual Studio editor - extend selection to the next larger code block?

查看:125
本文介绍了Visual Studio编辑器-将选择范围扩展到下一个更大的代码块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2010中,是否有任何方法可以将所选文本快速扩展到下一个逻辑代码块?例如,如果我的光标在这里:

In Visual Studio 2010, is there any way to quickly extend the selected text to the next logical code block? For example, if my cursor was here:

我点击了一些神奇的键盘快捷键,它将选择整个字符串:

And I hit some magical keyboard shortcut, it would select the entire string:

再次点击它,它将选择下一个更大的逻辑代码块:

Hit it again, and it would select the next larger logical block of code:

以此类推.是否存在?我的google-fu似乎使我不满意.

And so on. Does this exist? My google-fu seems to be failing me..

推荐答案

Visual Studio 2017 15.5.2在首次

Visual Studio 2017 15.5.2 appears to have this feature built-in after it was first hinted at in a Visual Studio 2017 Preview blog post (see section "Smart Code Editor").

可以通过转到Edit > Advanced > Expand Selection或将Edit.ExpandSelection命令绑定到Ctrl+W(实际上是如果没有任何先前的键绑定就开始使用新的默认值)来调用它.

Invoking it can be done by going to Edit > Advanced > Expand Selection or by binding the Edit.ExpandSelection command to Ctrl+W (actually the new default if you start without any previous keybindings).

也可以缩小/缩小选择范围,请查找Edit > Advanced > Contract SelectionEdit.ContractSelection命令(默认为Ctrl+Shift+W).

Shrinking / contracting the selection is possible as well, look for Edit > Advanced > Contract Selection or the Edit.ContractSelection command (default Ctrl+Shift+W).

这篇关于Visual Studio编辑器-将选择范围扩展到下一个更大的代码块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆