I realize I have a lazy shift finger that likes to stay on the shift key when putting in the finishing paren on a function definition to get to the new line and place the curly braces. The problem is that the Automatic Brace Completion uses this hotkey
to do some automatic formatting. I ended up not liking the way it did the automatic formatting and decided to turn off that feature.
Now my problem is that the old default functionality for SHIFT-ENTER is not restored. I just want to be able to hold the shift key and press enter to get to create a new line in my code; but instead, it now does nothing. The cursor just sits
there mocking my attempt to create beautifully formatted code.
Is there a way to restore the default handling of using SHIFT-ENTER?
Ha! I figured it out on my own. Firstly, when you switch the Automatic Brace Completion On/Off; you need to restart Visual Studio. This isn't a surprise, as it tells you right in the options when you switch it. However, it wasn't
immediately apparent that you need to close ALL instances of Visual Studio that you have open for the change to take effect.
Secondly, and most importantly, I found how/where to reassign the hotkey to return the default functionality back in the IDE. The first step is to turn off the Automatic Brace Completion option for the Productivity Power Tools and close all open Visual
Studio instances. Reopen Visual Studio and open the Tools->Options->Environment->Keyboard dialog. Type in the following text in the Show commands containing textbox: Edit.BreakLine
Select it in the results window. Make sure Global is selected for the
Use new shortcut in dropdown. Put focus on the Press Shortcut Keys textbox area and press SHIFT-ENTER. Click the Assign button. Click OK.
Whalah! You now have your default SHIFT-ENTER functionality.
Marcado como respuestaBelcawjueves, 07 de octubre de 2010 22:46
jueves, 07 de octubre de 2010 22:46
Microsoft está realizando una encuesta en línea para comprender su opinión del sitio web de Msdn. Si decide participar, se le presentará la encuesta en línea cuando abandone el sitio web de Msdn.