Jack @ ASP.NET

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘tab’

Visual Stusio 2010: Quickly Closing Documents

Before (VS 2008)

image

After (VS 2010)

image

The majority of feedback around this change was positive, but, as with most UI changes, there has been a vocal group that preferred the older placement.  When asked what they liked about the old placement, 99% of the time the response was, “I liked the ability to quickly close tabs by repeatedly clicking on the ‘X’ without moving my mouse.” 

I’ll admit it: I used that feature quite a bit to quickly close tabs.  That is, until I found out that there are better and more efficient ways to clean up the Tab Well.  Once I discovered these, I never looked back.  So, for this “Tips and Tricks” article, I wanted to share some of those ways to quickly close documents. 

 

image#1: Window->Close All Documents

Under the Window menu is a handy command: Close All Documents.  Clicking this will prompt you to save your work and will then close all documents that are currently open.  Yes, this does affect more than just the documents in the Tab Well – floating documents are also closed.  If you don’t want to take your hands off the keyboard, simply press Alt+ W, L, to invoke the command (You can also assign it a keyboard shortcut under Tools->Options->Environment->Keyboard).

 #2: Ctrl+F4

Another handy shortcut is Ctrl+F4 which, on most machines, is bound to the command Window.CloseDocumentWindow.  Pressing this keyboard combination will close the current document window that has focus.  Therefore, if you want to quickly get rid of a number of items in your tab well, just keep pressing Ctrl+F4 and eventually they’ll be gone. 

#3: Right-Click->Close All But This

If you want to close all but one open file, simply right-click on the tab and select Close All But This.  This will close all open documents (floating included) except the tab you’ve right-clicked on. 

#4: Middle Click

For those that prefer to use the mouse instead of the keyboard, there’s still a quick way to close tabs: the middle click.  This shortcut actually works in a number of other applicatios as well.  Simply place your mouse on the tab well and middle click to close the tab.  You can keep your mouse in the first spot and click away.

Tips and Tricks for the Visual Studio .NET IDE

1. Record and play temporary macro

Ctrl+Shift+R to record a new temporary macro. Press Ctrl+Shift+R to stop recording. Ctrl+Shift+P to play the recorded macro.

This works similar to *recording* in Vim. If you think you are going to be repeating a set of keyboard keys, then record them once and play them each time after.

2. Multiple copy/pastes

Ctrl+Shift+V cycles through the clipboard ring. You can copy/cut multiple times from one area of code, then go to another area and paste them one after another.

3. Drag and drop code snippets

The Toolbox (Ctrl+Alt+X) window has multiple tabs. You can drag and drop code onto this window and copy it elsewhere. Some tabs do not allow dropping code into them; those that allow will have the appropriate icon. The General tab works for me.

4. Previous cursor positions

Ctrl+- i.e. Ctrl + Hyphen. This cycles you through the code positions you visited.

Ctrl+Shift+- to navigate in the opposite direction.

5. Incremental search

To incrementally search for text as you type, first press Ctrl+i. Then type the word you want to search. Hit backspace to clear a character and enter to finish. Pressing F3 after this will work as usual, i.e. search for the next occurrence of previous search.

Ctrl+iCtrl+i works like F3.

6. Matching brace/comment/region/quote

Ctrl+] takes you to the matching brace. It also takes you to the matching comment, region or quote depending on what is at the cursor now.

7. Vertical block selection

Press Alt and then select the area you want with your mouse.

8. Closing/Showing support windows

There are a bunch of necessary/useful windows in the Visual Studio IDE like Properties (F4), Solution Explorer (Ctrl+Alt+L), Output Window (Ctrl+Alt+O), Task List (Ctrl+Alt+K) etc. However, they take up a lot of space. An easy way around this is to use the auto hide feature.

Open the window you want. Right click on its title and choose Auto Hide. The window will dock in whenever your mouse is not hovering over it.

9. Tab groups – group code editor windows

If you have many source code windows open, you can group them logically using tab groups. Right click the tab of the code window and choose New Horizontal Tab Group. This will move the window into a split window, allowing you to see both files. You can add more files to this new tab group and also move files back to the previous group by choosing Move To Previous Tab Group.

10. Track things you have to do with Task List

The Task List window (Ctrl+Alt+K) allows you to keep track of the things you have to do. Right click on the Task List window and choose Show Tasks|All to see a list of tasks. Ctrl+Shift+F12 to cycle through your list of tasks.

By default, comments marked with a TODO will appear in the task list.

11. Edit Task List Comment Tokens

You can add your own set of comment tokens (like the TODO comment token). Goto Tools|Options|Environment|Task List|Comment Tokens and make your changes. You can change the priority appearance of each comment token too.

12. Add Task List Shortcut

Add a shortcut to the task list with Ctrl+K, Ctrl+H. This will add the current line to the task list.

13. Auto-complete

Press Ctrl+Space or Alt+RightArrow to auto-complete the word. Intellisense suggestions may pop up a window if there is more than one possibility.

14. Intellisense suggestions window

Press Ctrl+Shift+Space to bring up the intellisense suggestions window. When giving parameters for functions, I often need to escape the suggestions window to check another part of code. To bring it back, I used to delete a comma and then type it again; but this is easier.

15. Word wrap

Ctrl+R Ctrl+R

or

Tools|Options|Text Editor|All Languages|General|Word Wrap

If you want to set this option for only one language, then choose the appropriate language instead of All Languages.

16. Line numbering

Tools|Options|Text Editor|All Languages|General|Line numbers.

Secrets of IE8

There are feature in IE8 (some of which are in older Internet Explorers as well) that have been around but never got the attention it deserved. I am going to go threw some of the futures that you may not know about below.

ctrl+Q: See a thumb nail view of all your Tabs ctrl qsimply by hitting control Q on your keyboard (Ctrl+Q). Seeing how most people are visual this will allow you to work quicker and more efficient.

Click on the tab you want or press Control Q again to go back to the tab you were on.

Close the tabs by clicking on the “X” in the upper right hand corner.

Right click to see what other options you can do with the tab.

Full screen: IE8 comes with only a favorites barfull screen and an area for the tabs, however some people like to install different tool bars that may clutter the top of there browser. Hit the “F11” key on your keyboard to toggle the page in and out of full screen.

Move the mouse to the top of the screen to see the rest of the browser the scroll bar is till on the right.

Alt+Tab will move you through windows while Ctrl+Tab will move you through tabs.
Ctrl+W will close your tab while
Ctrl+T will open a new tab.
And of course you can use the above Ctrl+Q to see all your tabs.

.

Improved Zoom: With enhanced resolution and readability, Zoom allows for automatic zoom2 scaling of a page’s content while maintaining the site’s intended layout. You can read very large or very small pages more clearly without having to scroll back and forth.

Press Ctrl+Mouse Role (if your mouse has this ability) to zoom in or out.

If your mouse does not do this Press Ctrl++ and Ctrl+-. (Control and Plus or control and Minus) With this feature and the last who will ever needs glasses anymore.

.

Tab Grouping: Taicon_tabgroupsb Grouping makes it easier to stay organized while browsing multiple webpages. Tabs that are opened from other tabs now have the same visual representation, and you can save time by closing a set of related tabs as a group by simply right-clicking. You also can right-click on a tab to close tab groups, ungroup a single tab, clone a tab, re-open a previously closed tab, or even open a new tab all together.

internet optionHome Tabs: In the morning when you open up your browser instead of opening up one tab with one Web site, open up as many as you want.

Go to the Tools->Internet Options and in the “Home Page” section type in the URL of each site you want to open in a separate tab on a separate line.

Suggeste d Sites: If you love that site, try this one. That’s the idea behind Internet icon_suggestedExplorer 8′s new Suggested Sites feature. At your request, Internet Explorer 8 can use your browsing history to suggest other sites you may like or find useful. It’s another way that Internet Explorer 8 helps you utilize the web to its full potential.

This is a simple WebSlice. Simply click to find out what other things may interest you you.

Smart Address Bar: Internet Explorer 8 helps you find where you icon_smartbarwant to go as you type the address of your desired website.

By using Windows Search for faster performance and a richer return of information, the Smart Address Bar offers useful suggestions from your browsing history, favorites, and feeds.

Type single words into the Smart Address Bar, and they will be matched to simple domain names, making web surfing fast and efficient.

In Private Browsing: Stop worrying about your information beingicon_inprivate stored on a Public computer. With industry-leading security features like InPrivate, you can browse and shop confidently using Internet Explorer 8, wherever you go on the web, knowing you have control over the protection of your personal information. Safety, trust, and reliability has always been IE’s number one concern.

Domain Highlighting: When you visit a site, its domain is highlighted in icon_domainthe Address Bar. This helps alert you to websites that are imposters of trusted sites, This will reduce the chance of compromising your personal information.

Take a look next time and make sure the site you want is the site you are on.

.Cross Site Scripting Filter: Check out the command bar (picture) for all the different Command barsafety  controls you have command over. Stay safer online and help protect yourself from malicious software running on compromised websites with the Cross Site Scripting Filter.

Compatibility View: Are some sites that you are going to looking icon_compatibilityweird, this is because the site you are visiting has not been updated in a while. Now you can easily display websites that were designed for older browsers. Simply press the Compatibility View button if you see display problems on a website like misaligned text, images, or text boxes