Skip to main content

Useful Visual Studio Shortcuts

1. Manage Visual Studio
Ctrl+s Save current file
Ctrl+Shift+s Save all files
Ctrl+Shift+n Create new project
Ctrl+o Open file
Ctrl+Shift+o Open project
Ctrl+Shift+a Add item to project
Esc Close menu or dialog
Ctrl+p Print
Shift+Alt+Enter Toggle full screen mode
Ctrl+f4 Close current tab
Ctrl+f6/Ctrl+Shift+f6 Go to next / go to previous window
Ctrl+Tab, then Arrow keys Press and hold Ctrl+Tab, then using arrow keys gives a small task manager with all open files and views
----------------------------
minus2. Bookmarks
For keystrokes with two keys such as Ctrl+k+k, keep holding the Ctrl key until releasing the last key.
Ctrl+k+k Toogle bookmark
Ctrl+k+n Goto next bookmark
Ctrl+k+p Goto previous bookmark
Ctrl+Shift+k+n Goto next bookmark in folder
Ctrl+Shift+k+p Goto previous bookmark in folder
Ctrl+k+w Put focus on bookmark window
Esc Leave bookmark window and focus on editor
Ctrl+k+h Toggle code shortcut at current line*
*if somebody figures out additional shortut keys on how to use code shortcuts, please edit this page and add.
----------------------------
minus3. Code Editor
minusFind, Replace, and Goto
Ctrl+f Find and replace dialog box
f3/Shift+f3 Find next / find previous
Ctrl+h Display Replace options on the quick tab
Shift+f12 Find all references for selected symbol
Ctrl+Shift+f Find in files
Alt+F3, s Stop current find in files operation
Ctrl+F3/Ctrl+Shift+f3 Find next / find previous in selected text
Alt+F12 Find symbol
Ctrl+d Put cursor in find/command box of the toolbar. Use ctrl+/ in Visual C#
Ctrl+i/Ctrl+Shift+i Incremental search / reverse incremental search
Shift+Alt+f12 Quick find symbol
Ctrl+, Display Navigate-To dialog box
Ctrl+g Goto line number
Ctrl+] Go to matching brace in source file
minusUndo, Redo, Copy, Paste
Ctrl+x, Ctrl+x, Ctrl+v Cut, copy, paste
Ctrl+Shift+v Pastes an item from the Clipboard ring
Ctrl+z Undo
Ctrl+y Redo (or Shift+Alt+Backspace, or Ctrl+Shift+Z)
minusSelect Text
Shift+Arrow Keys Extend selection one character/one line
Ctrl+Shift+End/ Ctrl+Shift+Home Extend selection to end / to beginning of document
Ctrl+Shift+] Extend selection to nexst brace
Shift+End/ Shift+Home Extend selection to end / to beginning of line
Shift+Page Down/ Shift+Page Up Extends selection down one page / up one page
Ctrl+w Select current word
Esc Cancel Selection
Ctrl+Shift+Page Down/ Page Up Moves cursor and extend selection to the last line / first line in view.
Ctrl+Shift+Arrow right/ arrow left Extend selection one word to the right / one word to the left
Ctrl+a Select All
----------------------------
minus4. Coding
minusCollapse Items
Ctrl+m+m Collapse / un-collapse current preset area (e.g. method)
Ctrl+m+h Collpase / hide current selection
Ctrl+m+o Collapse declaration bodies
Ctrl+m+a Collapse all
Ctrl+m+x Uncollapse all
Ctrl+m, ctrl+t Collapse Html tag
minusEdit Code
Ctrl+l Delete current line or selection of lines to and add to clipboard
Ctrl+Shift+l Delete current line or selection of lines
Ctrl+Delete Delete word to right of cursor
Ctrl+Backspace Delete word to left of cursor
Ctrl+Enter Enter blank line above cursor
Ctrl+Shift+Enter Enter blank line below cursor
Ctrl+Shift+u Make uppercase
Ctrl+u Make lowercase (reverse upercase)
Ctrl+k+c Comment selected text
Ctrl+k+u Uncomment selected text
Ctrl+k+\ Remove white space and tabs in selection or around current cursor position
Ctrl+k+d Format document to code formatting settings
Ctrl+k+f Format selection to code formatting settings
Ctrl+Shift+space Display parameter required for selected method
Ctrl+Shift+8 Visualize whitespace (or press Ctrl+r, then Ctrl+w)
Ctrl+k+d Format document to code formatting settings
Ctrl+k+f Format selection to code formatting settings
Ctrl+Shift+t Transpose word to right of cursor; makes b=a out of a=b if cursor was in front of a
Ctrl+t Transpose character left and right of cursor; cursor between ab would make ba
Shift+Alt+t Transpose line: Move line below cursor up and current line down.
minusIntelliSense and Code Helper
Ctrl+Space Autocomplete word from completion list (or alt+right arrow)
Ctrl+Shift+Space Show parameter info
Ctrl+f12 Display symbol definition
f12 Display symbol declaration
Ctrl+j Open IntelliSense completion list
----------------------------
minus5. Build and Debug
f7 Build solution (or Ctrl+shift+b)
Ctrl+Alt+f7 Rebuild solution
Ctrl+break Cancel build process
Ctrl+\+e Show error list
f9 Toggle breakpoint
Ctrl+b Insert new function breakpoint
f5 Start debugging
f11 Debug / step into
f10 Debug / step over
Shift+f11 Debug / step out
Ctrl+f10 Debug / run to cursor
Ctrl+Alt+q Show Quickwatch window
Ctrl+Shift+f10 Set current statement to be the next executed
Alt+* (on numeric keyboard) Show nexst statement
Ctrl+Alt+e Show Exception dialog box
Ctrl+f11 Toggle between disassembly and user code view
Shift+f5 Stop Debugging
Ctrl+f5 Bypass debugger
Ctrl+Alt+p Show attach to process window
Ctrl+Alt+break Break all executing threads

----------------------------
minus6. Tool Windows
Ctrl+/ Put cursor in the find/command box in toolbar
Ctrl+k+b Open code snippet manager window
Alt+f11 Open macro IDE window
Ctrl+k+w Open bookmark window
Ctrl+Alt+k Open call hierarchy window
Ctrl+Shift+c Open class view window
Ctrl+Alt+a Open Command window
Ctrl+Shift+o Open Output window
Ctrl+Shift+e Open Resource view window
Ctrl+Shift+s Open Server explorer window
Ctrl+Shift+l Open Solution explorer window
Shift+Esc Close Find & Replace Window

Comments

Popular posts from this blog

Tip/Trick: Fix Common SEO Problems Using the URL Rewrite Extension

Search engine optimization (SEO) is important for any publically facing web-site.  A large % of traffic to sites now comes directly from search engines, and improving your site’s search relevancy will lead to more users visiting your site from search engine queries.  This can directly or indirectly increase the money you make through your site. This blog post covers how you can use the free Microsoft  URL Rewrite Extension  to fix a bunch of common SEO problems that your site might have.  It takes less than 15 minutes (and no code changes) to apply 4 simple  URL Rewrite  rules to your site, and in doing so cause search engines to drive more visitors and traffic to your site.  The techniques below work equally well with both ASP.NET Web Forms and ASP.NET MVC based sites.  They also works with all versions of ASP.NET (and even work with non-ASP.NET content). [In addition to blogging, I am also now using Twitter for quick updates and to sh...

ASP.NET MVC - Set custom IIdentity or IPrincipal

Here's how I do it. I decided to use IPrincipal instead of IIdentity because it means I don't have to implement both IIdentity and IPrincipal. Create the interface interface ICustomPrincipal : IPrincipal { int UserId { get ; set ; } string FirstName { get ; set ; } string LastName { get ; set ; } } CustomPrincipal public class CustomPrincipal : ICustomPrincipal { public IIdentity Identity { get ; private set ; } public bool IsInRole ( string role ) { return false ; } public CustomPrincipal ( string email ) { this . Identity = new GenericIdentity ( email ); } public int UserId { get ; set ; } public string FirstName { get ; set ; } public string LastName { get ; set ; } } CustomPrincipalSerializeModel - for serializing custom information into userdata field in FormsAuthenticationTicket object. public class CustomPrincipalSerializeMode...

How to create a countdown timer in jquery

Create a countdown timer in jQuery First we need to include the jQuery library file to the HTML page to perform this task. To do that we need to understand that what exactly a jQuery library fie is ? JQuery library file is the library of JavaScript, which means this file contains the predefined functions of jQuery. We just need to call these functions to perform the task. jQuery functions reduces the lines of code and makes our task easy. As this jQuery library file contains the javascript functions so we need to call the function within <script> </script> tag. Now after including the file, we need to define a variable which will store that for how long you want the timer on the page(c=60) and now the time you set needs to be changed in hours , minutes and seconds using the code “ var hours = parseInt( time / 3600 ) % ;var minutes = parseInt( time / 60 ) % 60; var seconds = time % 60;” Now we need to put the condition if timer got finished (if (t...