Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcuts for Compare with Latest Version / Compare with Workspace version in Visual Studio 2012

This was easy in VS 2010, but I can't find the right items in VS 2012.

I'd like to set keyboard shortcuts for the Compare With Latest/Workspace Version context menu items in the TFS Pending Changes view. What's the item I should select in the Keyboard section of the Tools dialog?

like image 764
Ilya Kogan Avatar asked Nov 29 '12 00:11

Ilya Kogan


2 Answers

(This was tested with Visual Studio 2012 Update 1)

Tools > Options > Environment > Keyboard >

Under Show commands containing search and assign key combinations to:

TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithPreviousVersion - compares pending item in context to previous version.

TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithLatestVersion - compares pending item in context to latest version.

TeamFoundationContextMenus.PendingChangesPageChangestoInclude.TfsContextPendingChangesPageCompareWithWorkspaceVersion - compares pending item in context to workspace version.

File.TfsCompare - open the compare dialog.

like image 93
KMoraz Avatar answered Nov 16 '22 01:11

KMoraz


For me, this worked:

VS > Tools > Options > Environment > Keyboard > Show Commands Containing: Team.Git.CompareWithUnmodified

By assigning a shortcut key Ctrl+\, Ctrl+\ to this command ( Team.Git.CompareWithUnmodified) I can now compare my current file (the file that is open in the editor) to the previous version of the file by pressing the shortcut key Ctrl+\, Ctrl+\; no need to find the file in solution explorer, then right-click the file then select Compare.

(you can choose your own shortcut key of course)

Just a note on different behaviour:

  • Team.Git.CompareWithUnmodified works for me because I am using TeamExplorer in VisualStudio but I use GIT as the underlying source code repository.

  • Tfs.FileCompare could also work in other scenarios (i.e. if you don't use Git, but use VSTS or TFS as your source control provider).

  • Other: the command will be different if you use another source control provider.

like image 21
Spyder Avatar answered Nov 16 '22 01:11

Spyder