6 Of My Favorite Visual Studio Shortcuts
- 19
- Add a Comment
Welcome Back! I hope you enjoy the content on this site. If you have not done so already, you may want to subscribe to my RSS feed or become a fan of this blog on Facebook. Thanks for visiting!
These are some of my favorite and most used shortcuts in visual studio:
- Ctrl + - and the opposite Ctrl + Shift + - To move the cursor back or forward to the last position without having to scroll or switch files.
- Shift+Alt+Enter Switches to Full Screen Mode
- Ctrl+K, Ctrl+C Comment a block, Ctrl+K, Ctrl+U Uncomment the block
- Shift + Alt + F10 then Enter expands the smart tag to insert a using statement or implement an Interface
- Ctrl+K, Ctrl+D Auto format the file (Source, xml or html)
- Ctrl+M, Ctrl+ O Collapses all outlining to definition and then Ctrl+M, Ctrl+M to toggle the current block to expanded or collapsed.
What about you what are your favorites. I would like this post to become a repository for the most used Visual Studio Shortcuts. So do share
Hope This Helps!
Hatim
19 Comments
Valamas
December 21st, 2009
at 1:11am
Hi Hatim
(I think your first shortcut is meant to be CTRL [+] - and CTRL [+] SHIFT [+] -)
Here are some of my favourites…..
Quicker refactor, rename variable/method/etc.
1. Change name.
2. CTRL [+] . (dot)
3. Intellisence will show, just press Enter
The variable has been renamed without having to use the popup editor ( CTRL [+] R, CTRL [+] R )
Closing files
While navigating through code, i like to use CTRL [+] F4 to close the file. Handy if you know you have been surfing code a bit so you can help keep only the files you are working on open. Otherwise, it can get a bit messy.
Debugging code.
When using the F11 key to step into code, you can step into properties which can be annoying. Do the following to step into a method.
1. Click on the method name.
2. F12
3. CTRL [+] F10.
Your executing line is now in the function. Quick, set a breakpoint for future debugs.
John
December 21st, 2009
at 6:36pm
Ctrl + Alt + l –Solution Explorer
Esc to go back to current file.
Hatim
December 21st, 2009
at 6:40pm
Thanks Valamas,
it’s fixed now!
Viktar
December 21st, 2009
at 11:09pm
Ctrl+J - my favorite. It shows itellisence.
PK
December 22nd, 2009
at 4:41am
This is a great post.
I use 4 out of those 6 shortcuts. But, one more that I find really very useful is ctrl + *
This one comes from my VS6 days.
Ensure that your keyboard layout is set as VC++. Now whenever you go to the definition of a method, you can come back to it’s original position by ctrl + *
The Morning Brew - Chris Alcock » The Morning Brew #503
December 22nd, 2009
at 8:15am
[...] 6 Of My Favorite Visual Studio Shortcuts - Hatim Rih shares his 6 favourite Visual Studio keyboard shortcuts and asks for your suggestions of other good ones in the comments (where a good list is starting to form) [...]
Hatim
December 22nd, 2009
at 8:25am
Thanks PK, even though I don’t do a lot of C++ programming anymore this is a pretty useful shortcut!
Dew Drop – December 22, 2009 | Alvin Ashcraft's Morning Dew
December 22nd, 2009
at 12:28pm
[...] 6 Of My Favorite Visual Studio Shortcuts (Hatim Rih) [...]
Leyu Sisay
December 22nd, 2009
at 1:51pm
Ctrl+Tab
To bring up IDE Navigator
Rob Koch
December 22nd, 2009
at 2:04pm
My favorite … I have an aversion to #regions so every time I open a file Ctrl+M, Ctrl+P
Brad
December 22nd, 2009
at 2:06pm
A few others:
1) Go to a method defination: F12
2) Find all references to a method/variable: Shift + F12
3) Build only the current selected project (with C# settings). This is handy when working in multi-tier web evironment: Shift + F6
4) Toggle Expand/Collapse All items: CTRL + M, CTRL + L
5) Toggle, next, previous bookmark: CTRL + B, CTRL + (T, N, or P, respectively)
6) Toggle break point: F9
Here is a good MSDN site for VS shortcuts:
http://msdn.microsoft.com/en-us/library/xte2hh6a(VS.80).aspx
John Bubriski
December 22nd, 2009
at 2:59pm
Instead of using Shift + Alt + F1 to bring up the smart tag, just use Ctrl + .
I thought this one was obvious, but instead of Ctrl + j to bring up intellisense, just use Ctrl + Space. I feel like that might be a little easier to remember.
I Have similar shortcuts on my website at http://www.bubriski.com. I’m just about to do another 5 tips, so stay tuned!
Stefano RIcciardi
December 22nd, 2009
at 3:38pm
I have listed my favourites and my wish list in this post:
http://stefanoricciardi.com/2009/06/10/most-useful-visual-studio-2008-keyboard-shortcuts/
elpipo
December 22nd, 2009
at 7:34pm
There’s one not listed here yet that I often use when a collegue tells me to check a certain line in a file: Ctrl + g (go to line)
And another, Shit + F12 (show all references) I’m not sure if it’s a VS or third party shortcut.
And of course if you want a huge list of shorcuts, there a thread on StackOverflow that lists them: http://stackoverflow.com/questions/98606/favorite-visual-studio-keyboard-shortcuts
Cheers to all, good bye 2009 happy 2010 in advance to all’o'ya
Hatim
December 22nd, 2009
at 7:36pm
Thanks Elpipo, Happy new year to you too!!
elpipo
December 22nd, 2009
at 7:38pm
Ctrl + Shift + b = rebuild all
Alt + F5 = if I remember well, it’s for ASP.net to run without building project (like F5 without generating output)
forgot that one :p
Bilel
December 23rd, 2009
at 7:49am
My favorite is ALT + F4 at the end of the day to go home.
Sangam Uprety
December 25th, 2009
at 9:59am
Too often I use short keys in IDEs. However the most dearest to me are: format documents (Ctrl+K+D) and switch back and forth to design and code behind pages (F7,simple yet powerful!). And the one I missed the most is the short cut to comment, uncomment code block, both in code and markups, which neither I found yet nor explained in my elaborated list (here: http://dotnetspidor.blogspot.com/2009/06/22-visual-studio-short-keys-and-6-short.html). Thank you very much for revealing Ctrl+K+C and Ctrl+K+U!
links for 2010-01-08 | The Gryphin Experience
January 8th, 2010
at 8:04pm
[...] 6 Of My Favorite Visual Studio Shortcuts | Hatim's Development Blog (tags: development tips shortcuts reference) [...]