{"id":183943,"date":"2018-08-30T09:00:57","date_gmt":"2018-08-30T16:00:57","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/?p=18875"},"modified":"2019-02-14T15:23:35","modified_gmt":"2019-02-14T23:23:35","slug":"improving-your-productivity-in-the-visual-studio-editor","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/improving-your-productivity-in-the-visual-studio-editor\/","title":{"rendered":"Improving your productivity in the Visual Studio Editor"},"content":{"rendered":"<p>Over the last few updates to Visual Studio 2017, we\u2019ve been hard at work adding new features to boost your productivity while you\u2019re writing code. Many of these are the result of your direct feedback coming from the UserVoice requests, Developer Community tickets, and direct feedback we\u2019ve encountered while talking to developers like you.<\/p>\n<p>We are so excited to share these features with you and look forward to your feedback!<\/p>\n<h2>Multi-Caret Support<\/h2>\n<p>One of our <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/4408859-native-multi-editing-multiple-cursors-and-selecti\">top UserVoice items<\/a> asked for the ability to create multiple insertion and selection points, often shortened to be called multi-caret or multi-cursor support. Visual Studio Code users told us they missed this feature when working in Visual Studio. We heard you opened single files in Visual Studio Code to leverage this feature or installed extensions such as MixEdit, but in Visual Studio 2017 Version 15.8, you won\u2019t need to do this anymore. We\u2019ve added native support for some of the top requested features in the multi-caret family and we\u2019re just getting started.<\/p>\n<p>There are three main features we\u2019d like to highlight. First, you can add multiple insertion points or carets. With <b>Ctrl + Alt + Click<\/b>, you can add additional carets to your document, which allows you to add or delete text in multiple places at once.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/AddCarets.gif\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"GIF showing how to add carets in multiple locations\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/AddCarets.gif\" alt=\"GIF showing how to add carets in multiple locations\" width=\"298\" height=\"201\" \/><\/a><\/p>\n<p>Second, with <b>Shift + Alt + .<\/b> you can add additional selections that match your current selection. We think of this as an alternative to find and replace, as it allows you to add your matching selections one by one while also verifying the context of each additional selection. If you\u2019d like to skip over a match, use <b>(Ctrl + Shift + Alt + .) <\/b>to move the last matching selection to the next instance.<\/p>\n<p>Lastly, you can also grab all matching selections in a document at once <b>(Ctrl + Alt + Shift + ,) <\/b>providing a scoped find and replace all.<\/p>\n<h2>Quick Commands<\/h2>\n<p>Just like papercuts, smaller missing commands hurt when you add them up! We heard your pain, so in the past few releases, we\u2019ve tried to address some of the top features you\u2019ve asked for.<\/p>\n<h3>Duplicate line<\/h3>\n<p>The reduction of even a single keystroke adds up when multiplied across our userbase and one place we saw an opportunity to optimize your workflow was in duplicating code. The classic Copy + Paste worked in many cases, but we also heard in feedback that you wanted a way to duplicate a selection without affecting your clipboard. One scenario where this often popped up was when you wanted to clone a method and rename it by pasting a name you had previously copied.<\/p>\n<p>To solve this issue, we introduced Duplicate Code (<b>Ctrl + D<\/b>) in Visual Studio 2017 version 15.6 which streamlines the process of duplicating your code while leaving your clipboard untouched. If nothing is selected, Ctrl + D will duplicate the line the cursor is in and insert it right below the line in focus. If you\u2019d like to duplicate a specific set of code, simply select the portion of code you want to duplicate before invoking the duplicate code command.<\/p>\n<h3>Expand\/Contract Selection<\/h3>\n<p>How do you quickly select a code block? In the past, you could incrementally add to your selection word by word or perhaps you used a series of Shift plus arrow keystrokes. Maybe you took that extra second to lift you hand off the keyboard so you could use a mouse instead. Whatever the way, you wanted something better. In Visual Studio 2017 version 15.5, we introduced expand \/contract selection which allows you to grow your selection to the next logical code block (<b>Shift<\/b> + <b>Alt<\/b> + <b>+<\/b>) and decrease it by the same block if you happen to select too much (<b>(Shift<\/b> + <b>Alt<\/b> + <b>&#8211;<\/b>).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/ExpandContract.gif\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"gif showing expand \/contract selection which allows you to grow your selection to the next logical code block and decrease it by the same block\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/ExpandContract.gif\" alt=\"gif showing expand \/contract selection which allows you to grow your selection to the next logical code block and decrease it by the same block\" width=\"519\" height=\"210\" \/><\/a><\/p>\n<h3>Moving between issues in your document<\/h3>\n<p>You\u2019ve been able to navigate to Next Error via <b>Ctrl + Shift + F12<\/b> but we heard this experience was sometimes jarring as Next Error might jump you all around a solution as it progressed through issues in the order they appeared in the Error List. With Next\/Previous Issue (<b>Alt <\/b>+ <b>PgUp\/PgDn) <\/b>you can navigate to the next issue (error, warning, suggestion) in the current document. This allows you to move between issues in sequential versus severity order and gives you more progressive context as you\u2019re moving through your issues.<\/p>\n<h3>Go To All \u2013 Recent Files and File Member search<\/h3>\n<p>You can now view and prioritize search results from recent files. When you turn on the recent files filter, the Go To All results will show you a list of files opened during that session and then prioritizes results from recent files for your search term.<\/p>\n<p>Additionally, Go To Member is now scoped to the current file by default. You can toggle this default scope back to solution level by turning off Scope to Current Document<b> (Ctrl + Alt + C). <\/b><\/p>\n<h3>Go To Last Edited Location<\/h3>\n<p>We all know the feeling of starting to write a feature and then realizing we need some more information from elsewhere in the solution. So, we open another file from Solution Explorer or Go to Definition in a few places and suddenly, we\u2019re far off from where we started with no easy way back unless you remember the name of file you were working in originally. In Visual Studio 2017 version 15.8, you can now go back to your last edited location via <b>Edit <\/b>&gt;<b> Go To <\/b>&gt; <b>Go To Last Edit Location (Ctrl + Shift + Backspace).<\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/NavigateMenu.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"Expanded Navigation Context Menu\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/NavigateMenu.png\" alt=\"Expanded Navigation Context Menu\" width=\"400\" height=\"339\" \/><\/a><\/p>\n<h2>Keyboard profiles for Visual Studio Code and ReSharper<\/h2>\n<p>Learning keyboard shortcuts takes time and builds up specific muscle memory so that once you learn one set, it can be difficult to retrain yourself when the shortcuts change or create mappings that match your previous shortcuts. This problem came to light as we heard from users who frequently switch between Visual Studio and Visual Studio Code, and those who used ReSharper in the past. To help, we\u2019ve added two new keyboard profiles, <b>Visual Studio Code<\/b> and <b>ReSharper (Visual Studio)<\/b>, which we hope will increase your productivity in Visual Studio.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/Keyboard-profiles-for-Visual-Studio-Code-and-ReSharper.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"Keyboard profiles for Visual Studio Code and ReSharper\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/Keyboard-profiles-for-Visual-Studio-Code-and-ReSharper.png\" alt=\"Keyboard profiles for Visual Studio Code and ReSharper\" width=\"679\" height=\"460\" \/><\/a><\/p>\n<h2>C# Code Clean-up<\/h2>\n<p>Last, but certainly not least, in Visual Studio 2017 version 15.8, we\u2019ve configured <b>Format Document<\/b> to perform additional code cleanup on a file&#8211;like remove and sort usings or apply code style preferences. Code cleanup will respect settings configured in an .editorconfig file, or lacking that rule or file, those set in <b>Tools<\/b> &gt; <b>Options<\/b> &gt; <b>Text Editor<\/b> &gt; <b>C#<\/b> &gt; [<b>Code Style<\/b> &amp; <b>Formatting<\/b>]. Rules configured as <b>none<\/b> in an .editorconfig will not participate in code cleanup and will have to be individually fixed via the <b>Quick Actions and Refactorings<\/b> menu.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/Options-dialog-showing-format-document-options-for-C-Code-Clean-up.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"Options dialog showing format document options for C# Code Clean-up\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2018\/08\/Options-dialog-showing-format-document-options-for-C-Code-Clean-up.png\" alt=\"Options dialog showing format document options for C# Code Clean-up\" width=\"758\" height=\"525\" \/><\/a><\/p>\n<h2>Update and Give Feedback<\/h2>\n<p>With Visual Studio Version 15.8, you\u2019ll have access to all the features above and more so be sure to update to take advantage of everything Visual Studio has to offer.<\/p>\n<p>As you test out these new features, use the Send Feedback button inside Visual Studio to provide direct feedback to the product team. This can be anything from an issue you\u2019re encountering or a request for a new productivity feature. We want to hear all of it so we can build the best Visual Studio for you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last few updates to Visual Studio 2017, we\u2019ve been hard at work adding new features to boost your productivity while you\u2019re writing code. Many of these are the result of your direct feedback coming from the UserVoice requests, Developer Community tickets, and direct feedback we\u2019ve encountered while talking to developers like you. We [&hellip;]<\/p>\n","protected":false},"author":640,"featured_media":183949,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[1383,526,156],"class_list":["post-183943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-c","tag-productivity","tag-visual-studio-2017"],"acf":[],"blog_post_summary":"<p>Over the last few updates to Visual Studio 2017, we\u2019ve been hard at work adding new features to boost your productivity while you\u2019re writing code. Many of these are the result of your direct feedback coming from the UserVoice requests, Developer Community tickets, and direct feedback we\u2019ve encountered while talking to developers like you. We [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/183943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/640"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=183943"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/183943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/183949"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=183943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=183943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=183943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}