Excel-like switching between open tabs in Visual Studio editor - visual-studio

In Visual Studio I would like to be able to switch between open documents in the text editor just like I do in Excel or in a web browser - Ctrl-PgUp / Down moves me to the next and previous tabs in the order they appear on the screen.
I am trying to reproduce the same behavior in VS2015/17, but all I find is Window.NextDocumentWindow / PrevDocumentWindow commands, which do achieve a similar effect but they switch between open files not in their screen order, which is very annoying.
Is there an extension or macro of some kind which achieves the behavior I want?

Related

How do I stop Visual Studio 2022 find starting a new set of editor tabs?

I use various finds to do basically all my navigation in VS... haven't been back to .NET for a while, and are using VS 2022, but there's a behaviour I can't handle, and I'm wondering how to stop it.
Basically
I have a set of code open in a bunch of tabs.
I hit the key to open the "find in files" window and put in a search
It opens a new pane with find results in it.
Clicking on any file inside the find results opens that file IN THIS NEW PANE
So suddenly I have two sets of editor tabs. I never want two sets of editor tabs.
How do I stop it doing this?
It sounds like your Find Results window is Docked as Tabbed Document. In this case, right click the Find Results tab and select Dock to fix the problem.

Multiple windows in Visual Studio

I've just come to Visual Studio 2008 from a UNIX / Java background.
In Visual Studio, how can I have multiple overlapping editor windows? In Eclipse, I can open a new Window, add an editor to each of them, then Alt-Tab between them, overlap them, select them in the Taskbar, etc. Similarly, I'd like to put 'Output' in it's own 'first class' window so I can easily Alt-Tab between that and an editor when on a laptop.
Studio tools lets me 'tear off' and editor window, but the 'torn off' window doesn't respect Alt-Tab rules, and always hides the main Visual Studio pane.
Update: By way of example, In 'Word' I can have two documents open. I can Alt-Tab between them. I can Alt-Tab between either document, or Alt-Tab from either one to Outlook if I wish. I can overlap the documents, or place them side-by-side. I can place one document on one monitor, and one document on the other. I can have have Outlook open on one screen, overlapping one of the Word documents, while I edit the other. This is the kind of thing I would like to do with my source files!
You can change the window layout in the Tools menu under Options. The very first item is Environment\General. You can choose Multiple Documents (versus Tabbed Documents). That may give you the "look" you are describing.
However, I don't think it is possible to use alt+tab to change windows since those windows still belong to the single instance of VS2008. You can change windows with ctrl+F6. In addition, a nice trick when using Tabbed Documents is to press ctrl+alt+down arrow. That brings up a list of all open editor windows.
Alt+Tab is for switching between applications on Windows.
To switch between windows within Visual Studio use Ctrl+Tab.
This should work on any mutli-windowed application.
You can click on the tab of the window and drag outside making it a standalone window.
If you are a vim user, and install VsVim, you have an effective work around for dealing the quirky behaviour Visual studio has for moving between file editing windows.
You can easily make vertical and horizontal split windows within the "main" file editing window, just as you would in vim, using the regular vim keys. e.g. with any of the regular vim commands :vs, <C-w>s, <C-w>v, ...
If you tear off a second editing window (e.g. with the mouse) and put it on a separate monitor, you can use Vim's global marks, or <C-w>w (and similar commands for navigating between panes in vim) to jump between file editing windows across different monitors/screens with just a few keys.

What is the best way to bookmark positions in code in Visual Studio 2008/2010?

I find myself going to about five or six main places in my code 80% of the time and would like a way to go to them fast even if all files are closed.
I would like to be able to open up a solution in Visual Studio and without any files open, see a list of self-labeled bookmarks like this:
LoadNext
Settings page refresh
app.config connections
app settings
stringhelpers top
stringhelpers bottom
I click one of these and it opens that file and jumps to that position.
How can I best make bookmarks like this in Visual Studio 2008/2010?
Use task list shortcuts:
On a line in text editor use keys (ctrl + k, ctrl + h) this will add a task list shortcut.
Open task list tool window.
In task list tool window select "short cuts" in the drop-down list.
The task list will the show a list of lines where you made a task list shortcut, whit the text from that line.
Why not use the Bookmarks feature? I have the Bookmarks window at the bottom of my Visual Studio window, collapsed. You can view this by going to View -> Other Windows -> Bookmark Window (in VS 2008, anyway).
You can add a bookmark to any line of code; it will then appear in the Bookmarks window. You can then rename the bookmark to whatever you want. It doesn't matter if the file is open or not.
I'm assuming you want this on a per-solution basis rather than a generic set of bookmarks that know how to find a particular type of file. The approach above would seem to be what you want. It seems like Visual Studio remembers a set of bookmarks for each solution; I guess they're stored in the .suo file.

How do I view Visual Studio BuildLog.htm files without cutting and pasting into an external browser

This may or may not be specific to VS2005 (as that is the version I'm referring to for this question).
I find often the case is that I see this in the Output panel inside Visual Studio
2>Build log was saved at "file://c:\\vsdll_example\MyExecRefsDll\Debug\BuildLog.htm"
Now, since that looks and smells like a URL, I would have thought that I could simply left mouse click on it, or left mouse double-click on it, and a browser window of some sort would be displayed. No, that doesn't work. So, to view it, I have to cut and paste the "file://bla/bla/bla" part into an external window.
Is there a way to set up Visual Studio to allow me to browse to that file directly, or view it inside Visual Studio IDE, or something to that effect, without the extra fiddling with cutting and pasting? Or is there some type of keybinding I'm not aware of?
Thanks,
bg
Hold down Control while clicking on the link. It should show up in the editor.

How do I get a code window to split vertically in Visual Studio 2008? (not HTML mode)

In Visual Studio 2008, it seems that Window -> Split only gives me a horizontal split, and Window -> New horizontal tab group does not allow me to edit the same file in both panes.
Note that I am talking about C# code windows, not HTML editing mode.
I want to edit the same file in two horizontally arranged panes.
Is this possible? Free add-ons are fine.
Edit: I have CodeRush Express installed, and it seems to have done something to my code window borders.
Edit #2: It's not CodeRush. I tried on VM with no CodeRush, and I have exactly the same issue.
Ok, I found the solution here.
The answer is:
Window -> New Window
Window -> New Vertical Tab Group
This duplicates the current tab so you'll get [Form1.cs:1] and [Form1.cs:2] tabs; and then you can use a vertical tab group to view them side by side.
I believe that it's not CodeRush's fault. A vanilla 2008 install only lets you do the split view with one file on the top and one file on the bottom. The only side-by side option is the horizontal tab-group feature (with the problem of only having a file open in one of them, as you mentioned.)
The obvious workarounds would be to either make a read-only copy of the file elsewhere and use that in one tab-group, or open up a second instance of VS. It does have decent handling of files that get changed in other apps, so having the same file open in two instances isn't a problem.
In VS2010 I couldn't find the Vertical Tab group button. The workaround is:
1. Open Fullscreen mode
2. Click and drag the window to the far right (or left) and it should give
you an option to view both windows side by side.
3. Exit full screen mode and you should now have the ability to click and
drag windows between vertical tab groups, and it even now allows you to
drag to a new vertical tab group.
No idea why you have to jump into fullscreen first, and i seem to remember not having to do that before.
As a one-time developer on CodeRush, I doubt that this would be caused by CodeRush Xpress. I'm currently running the latest beta of CodeRush 9.1.0 on Visual Studio 2008, and splits are working fine. However, you could certainly try uninstalling CodeRush Xpress to see if that clears up the problem. If it does, I would recommend posting in DevExpress' peer-to-peer forums.
alt text http://diditwith.net/content_images/CRXSplits.png
I like the vertical tab group option. The only thing that bothers me about it is that I cannot put the solution explorer on both windows (Or properties for that matter). I have to navigate all on one side and move screens around.
I found this nifty add on tool for VS 2012 that allows you to compare two files at the same time and make changes.
Check this out:

Resources