Visual Studio最有用(未充分利用)的提示
There was a cool comment in my last blog post (one of many, as always, the comments > the content).
在我的上一篇博客文章中,有一个很酷的评论(与往常一样,其中很多都是评论>内容)。
Btw, "until I realized that the Solution Explorer tree nodes are searchable." This one is a saver!
顺便说一句,“直到我意识到解决方案资源管理器的树节点都是可搜索的。” 这个很省钱!
The commenter, Sam, noticed a throwaway bit in the middle of the post where I noted that the Solution Explorer was text-searchable. There's a lot of little tricks like this in Visual Studio that even the most seasoned developers sometimes miss. This phenomenon isn't limited to Visual Studio, of course. It's all software! Folks find non-obvious UX all the time in Windows, OSX, iPhone, everyday. If UX were easy then everything would be intuitive but it's not so it ain't. ;)
评论员Sam注意到帖子中间有很多地方,我注意到解决方案资源管理器是可文本搜索的。 在Visual Studio中有很多这样的小技巧,即使是经验最丰富的开发人员有时也会错过。 当然,这种现象不仅限于Visual Studio。 全部都是软件! 人们每天都在Windows,OSX,iPhone中始终发现不明显的UX。 如果UX很简单,那么一切都会很直观,但事实并非如此。 ;)
There's an old joke about Microsoft Office, which is known for having a zillion features.
关于Microsoft Office有一个古老的玩笑,它以拥有无数的功能而闻名。
"Most of the exciting new Office features you discover have always been in Office." - Me and Everyone Else
“您发现的大多数令人兴奋的Office新功能始终都在Office中。” -我和其他所有人
Here's some exceedingly useful stuff in Visual Studio (It's free to download and use, BTW) that folks often miss.
这是人们经常会错过的Visual Studio中一些非常有用的东西(BTW是免费下载和使用)。
使用Ctrl +搜索解决方案资源管理器; (Search Solution Explorer with Ctrl+;)
You can just click the text box above the Solution Explorer to search all the the nodes - visible or hidden. Or, press "Ctrl + ;"
您只需单击解决方案资源管理器上方的文本框即可搜索所有节点-可见或隐藏。 或者,按“ Ctrl +;”
Even stuff that's DEEP in the beast. The resulting view is filtered and will remain that way until you clear the search.
甚至是野兽深处的东西。 结果视图将被过滤,并且将保持这种状态,直到您清除搜索。
快速启动-Ctrl + Q (Quick Launch - Ctrl+Q)
If there is one feature that no one uses and everyone should use, it's Quick Launch. Someone told me the internal telemetry numbers show that usage of Quick Launch in the single digits or lower.
如果有一项功能没有人使用,每个人都应该使用,那就是快速启动。 有人告诉我内部遥测数字表明快速启动的使用位数或更低。
Do you know that you (we) are constantly digging around in the menus for stuff? Most of you use the mouse and go Tools...Options...and stare.
您是否知道您(我们)不断在菜单中寻找东西? 你们大多数人都使用鼠标,然后转到工具...选项...然后凝视。
Just press Ctrl+Q and type. Need to change the Font Size?
只需按Ctrl + Q并键入。 需要更改字体大小吗?
Want to Compare Files? Did you know VS had that?
要比较文件吗? 你知道VS有吗?
What about finding a NuGet package faster than using the NuGet Dialog?
与使用NuGet对话框相比,找到NuGet包的速度更快?
Promise me you'll Ctrl+Q for a few days and see if you can make it a habit. You'll thank yourself.
答应我,请按Ctrl + Q几天,看看是否可以养成习惯。 你会感谢你自己的。
滚动条的地图模式 (Map Mode for the Scroll Bar)
I love showing people features that totally surprise them. Like "I had NO IDEA that was there" type features. Try "map mode" in the Quick Launch and turn it on...then check out your scroll bar in a large file.
我喜欢向人们展示令他们惊讶的功能。 就像“我在那里没有想法”这类功能。 在“快速启动”中尝试“地图模式”并将其打开...然后在大文件中签出滚动条。
Your scrollbar will turn into a thumbnail that you can hover over and use to navigate your file!
滚动条将变为缩略图,您可以将其悬停并用于导航文件!
标签管理 (Tab Management)
Most folks manage their tabs like this.
大多数人都是这样管理标签的。
- Open Tab 打开标签
- Repeat重复
- Declare Tab Bankruptcy宣告标签破产
- Close All Tabs关闭所有标签
- Goto 0转到0
But you DO have both "pinned tabs" and "preview tabs" available.
但是您确实有“固定选项卡”和“预览选项卡”可用。
If you pin useful tabs, just like in your browser those tabs will stay to the left and stay open. You can not just "close all" and "close all but this" on a right click, but you can also "close all but pinned."
如果您固定有用的标签,就像在浏览器中一样,这些标签将保持在左侧并保持打开状态。 您不仅可以右键单击“全部关闭”和“除此以外的所有内容”,还可以“仅关闭固定的所有内容”。
Additionally, you don't always have to double-click in the Solution Explorer to see what's in a file. That just creates a new tab that you're likely going to close anyway. Try just single clicking, or better yet, use your keyboard. You'll get a preview tab on the far right side. You'll never have more than one and preview tabs won't litter your tab list...unless you promote them.
此外,您不必总是双击解决方案资源管理器即可查看文件中的内容。 这样只会创建一个新标签,您可能仍要关闭它。 只需单击一下即可尝试,或者最好使用键盘。 您将在最右侧获得预览标签。 您将永远不会有一个以上的标签,并且预览标签不会分散您的标签列表...除非您将其升级。
导航至-Ctrl +(Ctrl +逗号) (Navigate To - Ctrl+, (Control+Comma))
Absolutely high on the list of useful things is Ctrl+, for NavigateTo. Why click around with your mouse to open a file or find a specific member or function? Press Ctrl+, and start typing. It searches files, members, type...everything. And you can navigate around with your keyboard before you hit enter.
Ctrl +是NavigateTo绝对有用的东西。 为什么用鼠标单击以打开文件或查找特定的成员或功能? 按Ctrl +,然后开始键入。 它搜索文件,成员,键入...所有内容。 在按Enter键之前,您可以使用键盘四处导航。
There's basically no reason to poke around in the Solution Explorer if you already know the name of the item you want to see. Ctrl+, is very fast.
如果您已经知道要查看的项目的名称,则基本上没有理由在解决方案资源管理器中四处浏览。 Ctrl +,非常快。
用键盘移动线 (Move Lines with your keyboard)
Yes I realize that Visual Studio isn't Emacs or VIM (unless you want it to be VsVim) but it does have a few tiny tricks that most VS users don't use.
是的,我意识到Visual Studio不是Emacs或VIM(除非您希望它是VsVim ),但是它确实有一些大多数VS用户不使用的小技巧。
You can move lines just by pressing Alt-up/down arrows. I've never seen anyone do this in the wild but me. You can also Shift-Select a bunch of lines and then Alt-Arrow them around as a group.
您只需按Alt /上/下箭头即可移动线条。 除了我,我从来没有见过有人在野外这样做。 您也可以按住Shift键选择一堆线,然后将它们作为一组Alt-箭头。
You can also do Square Selection with Alt and Drag...and drag yourself a nice rectangle...then start typing to type on a dozen lines at once.
您还可以使用Alt和Drag进行Square Selection ...并拖动自己一个漂亮的矩形...然后开始键入以一次键入十几行。
Perhaps you knew these, maybe you learned a few things. I think the larger point is to have the five to ten most useful features right there in your mind ready to go. These are mine. What are your tips?
也许你知道这些,也许你学到了一些东西。 我认为更重要的一点是,您可以随时准备使用5到10个最有用的功能。 这些是我的。 你有什么秘诀?
Sponsor: Do you deploy the same application multiple times for each of your end customers? The team at Octopus have been trying to take the pain out of multi-tenant deployments. Check out their 3.4 beta release.
发起人:您是否为每个最终客户多次部署相同的应用程序? Octopus的团队一直在尝试减轻多租户部署的痛苦。 查看他们的3.4 Beta版本。
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。
翻译自: https://www.hanselman.com/blog/visual-studios-most-useful-and-underused-tips