Blame source file from within visual studio - visual-studio-2010

I'm using AnkSVN within Visual Studio 2010, and it covers ~95% of my SVN needs. The biggest missing feature is that I can't find a way to blame a file from directly within VS. The workaround I currently use is to right click on the file within the tablist, and select Open Containing Folder, and then right clicking on the file in Explorer to call Blame.

It's called Annotate in AnhkSVN.
Subversion -> Annotate in the context menu.

I didn't like AnkhSVN's Annotate feature. So I used the following:How to integrate TortoiseSVN into Visual Studio.
Content from above url:
If you're using Visual Studio, you can integrate TortoiseSVN commands to various context menus.
The first step is to add the TortoiseSVN commands as external tools, under the menu TOOLS->External Tools....
Add the name of the command, the path to TortoiseProc.exe and then the parameters for the command.
Use the VS variables wherever needed. Since I add my commands to the context menu of the open file tab, here's the parameters I used:
/command:blame /path:"$(ItemPath)" /line:$(CurLine)
/command:diff /path:"$(ItemPath)"
/command:log /path:"$(ItemPath)"
Notice the /line: parameter: this will make TortoiseBlame automatically scroll to the same line the cursor is located in the opened file in Visual Studio.
Now to add those new commands to the file tab context menu, go to TOOLS->Customize..., select the Commands tab, click the radio button Context menu and then select Other Context Menus | Easy MDI Document Window.
Now you have to select the commands. Problem is that the custom commands are not shown with their title but only as External Command X with X being the number of the external command.
In my case, the commands were number 9-11, you might have to do some trial-and-error here. Just add the commands you think are the ones you added and then check if the right ones show up in the context menu.
NOTE: In Visual Studio 2010 to add a command to the right-click menu of a document’s tab, first you’ll need to right-click on a Visual Studio document tab to work around a Visual Studio bug. (Otherwise the Easy MDI Document Window context menu doesn’t show up in the Customize dialog.) Source

Related

Is there a way to set a keyboard shortcut to open containing folder of a selected file in Solution Explorer in Visual Studio?

When I click on a C++ project in Visual Studio, I get this menu:
And so I can quickly press Alt+F,F(Command ProjectandSolutionContextMenus.Project.OpenFolderinFileExplorer) to open the folder of the project.
I also found that I can open containing folder if I open the file in the Text Editor in Visual Studio:
I bound it to Alt+F,F as well. I set it to only be active in Text Editor, it's the File.OpenContainingFolder command.
But when I click on files inside the project in the Solution Explorer, there is no context menu:
I tried to make the File.OpenContainingFolder command global, but it still doesn't work in the Solution Explorer when I just click on a file once. If I double click it and open it in the text editor, it works.
And I can't find a command in the Keyboard section in options of Visual Studio to open containing folder of a file selected in the Solution Explorer.
Maybe someone knows how to do it?
You can create an external tool menu item, and then bind a shortcut to that item.
Go to Tools > External Tools.
Click Add.
In Title edit box type Show in Explorer.
In Command edit box type explorer.exe.
In Arguments edit box type /select, $(ItemPath). There is a space between a comma and a dollar sign.
Click OK.
Make note at the position of the new command in the list. It could be first, it could be fifth, or something else. Let's assume it's the fifth one.
Assign a shortcut to the command Tools.ExternalCommand5. Restrict the shortcut to Solution Explorer.
That's it.

Is there a Command in Visual Studio for "Navigate to this item in TFS Source Explorer"

I want add a command to the R-Click context menu in the Solution Explorer that would navigate the TFS Source Explorer window to the right location corresponding to the item in question.
However I can't see how to do it simply without writing a VS extension, which I want to avoid at all costs.
It's not that I don't want extensions. I just don't want to write a custom one. Previously I'd be able to use macros but those were removed in these versions of Visual Studio.
The VSCommands extension will give you the option to locate a file in TFS and in the Solution Explorer
The Locate in TFS extension adds a context menu entry Locate in TFS to Solution Explorer and Open Tabs.

Visual Studio Team Explorer can't properly open a PDF file - Solution Explorer not available for "open with" setting

We have PDF (and other) files attached to TFS Work Items and in Source Control under TFS. They are not opened correctly (they show up as ASCII, basically) in Visual Studio.
The problem seems to be that until you use the 'Open With..' dialog from the Solution Explorer, VS doesn't properly associate a program with extensions like '.pdf'.
If our users had a full installation of Visual Studio, that would be an ok work-around. However, many of them only have Visual Studio 2013 with the Team Explorer component - no Solution Explorer at all.
I'm guessing that there must be some workaround for this case. Perhaps setting the proper registry value? Since VS properly remembers the association if you can tell it (through the Solution Explorer), it must be stored somewhere.
Ideas? Suggestions?
If you've got a PDF file in a project you can right-click in the solution explorer and choose "Open with..". Now you can choose which editor you want to use. If Acrobat isn't already listed you can add it and after that click the button "Set as default".
After that, your PDF's will always open with Acrobat Reader regardless if you open it from source control browser or elsewhere in the Visual Studio. But you need to configure that for all your Studios.
Reference: Answer in MSDN "Source Control Explorer Doesn't View PDF Files"
"Open with" is not available in context menu. But I found solution - well better said workaround:
You have to create external command to open this pdf file in you pdf viewer.
Go to Tools/External tools.
In command section, enter path to your PDF viewer (exe file)
In Arguments, choose "Item path". Save it under preferred name
Put this new command you created in some of existing toolbars or create new one for it. This is also little complicated, so here is how:
Hit the small arrow next to the existing toolbar, choose customize
In the new window, choose "Add command"
In the new window, your new command is hidden under the category "Tools" as command "External command 1". Add it and confirm.
Now here comes the nasty trick. This command will not work in the browser window with PDF file selected, the argument is empty :(
So you have to OPEN the pdf file into that ASCII window and THEN hit the new command. Now the file will open in you selected pdf viewer.
Hope this will help someone

Moving from Visual Studio to Sublime Text

I'm working with Sublime Text for a while now and it works perfectly! But at my new work they're using Visual Studio, with some plugins and shortcut changes I'm now be able to work a little bit faster but I prefer Sublime Text.
Why I'm stuck to Visual Studio at my work is because of 3 things:
1. TFS: Team Foundation Server
I've found the Sublime TFS plugin, I haven't tested it yet but I think it works the same as the Sublime SVN plugin which I don't like (no status on checkout, just waiting until it's done). For SVN I'm using TortoiseSVN which works nicely. Is there something like TortoiseSVN for TFS?
2. Solutions
If I browse to the solution/product folder on my computer, add a new file and go back to Visual Studio I've to include that file into the solution/project. I'm used to exclude files which I don't like to use in my project instead of include. Is it possible to change this?
3. Build system
After every change I've to build. Instead of just save (F5) and go to my browser (ALT-TAB) which refreshes automatically after every change, I have to save (F5), build (SHIFT-F6), go to my browser (ALT-TAB) and refresh (F5) with Visual Studio. I'm pretty handy with it now, but I think this can be done easier. So is it possible to build automatically after saving?
What I did until now is searching on Google. I've found some interesting things but nothing which covers these 3 things. For example; here a simple tutorial for the build system. I hope someone can help me out with this so I can say good bye to Visual Studio and return to Sublime Text with love.
I have setup a shortcut key in Visual Studio to open my files in Sublime Text Editor. Below is a step by step guide to doing this.
Step 1:
Open Visual Studio, Go to "Tools" menu and Select "External Tools..."
Step 2:
Click on "Add". Set up a Title say "Open in Sublime" , browse to "sublime_text.exe" to the set the Command textbox. For the arguments fill them with $(ItemPath):$(CurLine):$(CurCol) - this will tell Sublime to open the Visual Studio's current file and go to the same location within that file. Set the Initial Directory to $(ItemDir).
Step 3:
Now if you go Menu > Tools you will find our newly added "Open In Sublime" option. Now let's take this one step forward and setup a shortcut key for this.
Step 4:
Go to Menu > Tools > Options, Under Environment select "Keyboard". In the "Show command containing:" field search for "externalcommand6" and press in your shortcut key combination you want to assing and click the "Assign" button. Avoid combinations that are already in use.
That's it you're done
Sublime text editing is now just a keystroke away.
You can use them both. Visual studio is an ide and manages a lot more then just editing the text files.
If you want to use your text editor of choice you just need to get familure with the command line tools that VS hides from you.
For TFS tasks you need to use TF
When you need to build just invoke MSbuild which is what Visual Studio more or less does anyway. You can also edit the project files by hand as there just msbuild files.

Invoke an exe from Visual Studio's toolbar

How do you customize a button in a Visual Studio toolbar to run a certain executable?
I use VS2010, so a specific answer would be even better, although this might be the same cross versions...
Under Tools, External Tools add your executable.
To make it appear in the toolbar then click on the small triangle at the end of the toolbar and select Add or Remove Button, then Customize. Click Add Command and from category Tools select External command 1 (or another if you have multiple).

Resources