{"id":227433,"date":"2019-11-13T09:57:53","date_gmt":"2019-11-13T17:57:53","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=227433"},"modified":"2019-11-13T09:57:53","modified_gmt":"2019-11-13T17:57:53","slug":"visual-studio-for-mac-take-control-of-your-ide-with-keybindings","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-for-mac-take-control-of-your-ide-with-keybindings\/","title":{"rendered":"Visual Studio for Mac: Take Control of Your IDE with Keybindings"},"content":{"rendered":"<p>The great debates in computing all have one common theme. Whether it is tabs vs. spaces or Vi vs. Emacs, the thread linking all these debates together is keyboard efficiency. The truth is, we spend tons of hours working in an application, and keyboard shortcuts become automatic to us, the same muscle memory that great pianists or sports players have. If you suddenly give a virtuoso pianist a piano where the keys are half as wide and the sharp\/flat keys are below as opposed to above the natural keys, they will struggle to make even the most basic melodies while they learn the new arrangement. Likewise, when it comes to keyboard shortcuts in your favorite IDE, any change can be disorienting quickly. Luckily, Visual Studio for Mac offers a ton of customizations to key bindings that will allow you get configure your key combinations to your liking.<\/p>\n<p><strong>First Run<\/strong><\/p>\n<p>New users to Visual Studio for Mac will notice right away that the IDE offers support for many different key mappings. The first time Visual Studio for Mac is launched on a computer, you will receive a prompt directing you to pick your favorite key mapping.<\/p>\n<p>Here, you can select from four different key mappings to help you be as productive as possible from the first line of code you write. But what if you want even more customizations? Well, Visual Studio for Mac has you covered there as well!<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-227143 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/ide-tour-2019-keyboard-shortcut-1.png\" alt=\"\" width=\"1664\" height=\"1106\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/ide-tour-2019-keyboard-shortcut-1.png 1664w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/ide-tour-2019-keyboard-shortcut-1-300x199.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/ide-tour-2019-keyboard-shortcut-1-768x510.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/10\/ide-tour-2019-keyboard-shortcut-1-1024x681.png 1024w\" sizes=\"(max-width: 1664px) 100vw, 1664px\" \/><\/p>\n<p><strong>More Customizing<\/strong><\/p>\n<p>While setting a default keymap is certainly handy, it doesn\u2019t solve all circumstances. There may be custom mappings that you\u2019ve used in other IDEs, or specific commands that are outside the bounds of the array of preconfigured options. With the Key Bindings selection window, you can map every possible command within the IDE to a specific key. To see the Key Binding options, select <strong>Visual Studio &gt; Preferences &gt; Environment &gt; Key Bindings<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227439\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb.png\" alt=\"\" width=\"2144\" height=\"1628\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb.png 2048w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-300x228.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-768x583.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-1024x778.png 1024w\" sizes=\"(max-width: 2144px) 100vw, 2144px\" \/><\/p>\n<p>There are several features that I want to point out in this window, and I will take you through them one by one. The most immediate option you see is that there is a dropdown available for various \u201cSchemes\u201d which map to the options that new users see when they first install the IDE. Here you can select from many different pre-packaged key bindings, such as Visual Studio, VS Code and Xcode.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-227440\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-list.png\" alt=\"\" width=\"2144\" height=\"1662\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-list.png 2048w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-list-300x233.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-list-768x595.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/settings-kb-list-1024x794.png 1024w\" sizes=\"(max-width: 2144px) 100vw, 2144px\" \/><\/p>\n<p>But what if you want even more control? What if you really, really want \u201cFind Derived Symbols\u201d to be mapped to <strong>C<\/strong><strong>ontrol-Option-D<\/strong>? Setting custom keybindings is super easy in Visual Studio for Mac. To get started, you can either scroll through the list of available commands, or search for the command in the search box. The list of available commands is organized by type of command and can be collapsed for easier navigation. Once you find the command you would like to map, you can select it and then type the desired key binding in \u201cEdit Binding\u201d followed by clicking \u201cApply\u201d. In the below GIF, I set the binding for \u201cNew Breakpoint\u201d to <strong>C<\/strong><strong>ontrol-Shift-<\/strong><strong>B<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-227434 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/keybinding-blog-setbp.gif\" alt=\"\" width=\"1280\" height=\"936\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You can also edit an existing breakpoint in a very similar manner. In the below GIF, you can see how to edit the \u201cNew File\u201d command to map to <strong>Control-Shift-N<\/strong>\u00a0from the default <strong>C<\/strong><strong>ommand-N. <\/strong>You\u2019ll notice that all I need to do is type in the command I prefer and click apply. If you want to add multiple bindings, simply click \u201cAdd\u201d instead of \u201cApply\u201d.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-227437 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/keybinding-blog-addnewfile.gif\" alt=\"\" width=\"1280\" height=\"936\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Finally, with so many commands to remember, it can sometimes be hard to keep track and avoid duplicates. To ensure that each key binding is unique, Visual Studio for Mac checks against all configured commands and warns you of a duplicate if one is detected. It will also check for command duplication, so you can either replace the original or your newly created binding. The GIF below shows what happens when mapping the \u201cNew Breakpoint\u201d command to the <strong>\u201cCommand-C\u201d<\/strong> keyboard binding which conflicts with \u201cCopy\u201d.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-227438 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/11\/keybinding-blog-dupe.gif\" alt=\"\" width=\"1280\" height=\"936\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now that you know how to edit the key mappings in any way you see fit, you can fully customize the IDE and get to writing code the way you love! If you want to see more key binding information, please check out our Toolbox video on the subject on <a href=\"https:\/\/channel9.msdn.com\/Shows\/Visual-Studio-Toolbox\/Visual-Studio-for-Mac-Keyboard-Shortcuts\">Channel 9<\/a><\/p>\n<p>If you have any feedback or suggestions, please leave them in the comments below. You can also reach out to us on Twitter at <a href=\"https:\/\/twitter.com\/visualstudiomac\" target=\"_blank\" rel=\"noopener noreferrer\">@VisualStudioMac<\/a>. For any issues that you run into when using Visual Studio for Mac, please\u00a0<a href=\"https:\/\/docs.microsoft.com\/visualstudio\/mac\/report-a-problem?view=vsmac-2019\" target=\"_blank\" rel=\"noopener noreferrer\">Report a Problem<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The great debates in computing all have one common theme. Whether it is tabs vs. spaces or Vi vs. Emacs, the thread linking all these debates together is keyboard efficiency. The truth is, we spend tons of hours working in an application, and keyboard shortcuts become automatic to us, the same muscle memory that great [&hellip;]<\/p>\n","protected":false},"author":561,"featured_media":227143,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[237,12,452],"class_list":["post-227433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-net","tag-visual-studio","tag-visual-studio-for-mac"],"acf":[],"blog_post_summary":"<p>The great debates in computing all have one common theme. Whether it is tabs vs. spaces or Vi vs. Emacs, the thread linking all these debates together is keyboard efficiency. The truth is, we spend tons of hours working in an application, and keyboard shortcuts become automatic to us, the same muscle memory that great [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/227433","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\/561"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=227433"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/227433\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/227143"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=227433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=227433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=227433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}