How to add a command to context menus in Visual Studio 2019 - menu

I'm trying to add a command to the Document Tab context menu in Visual Studio 2019 so I can go directly to the open file in the Solution Explorer. I'm aware of File Tracking. I don't want to open the folder for every file tab I click on. I'm also aware of this extension but it seems like I have to click it two, sometimes three times before it will go to the file.
I found the relevant context menu under Customize -> Commands. It's "Other Context Menus | Easy MDI Document Window". The problem is that under "Add Command" you can only add from preselected lists of commands, and they don't make things easy to find.
I can see the command I want to add under Options -> Environment -> Keyboard. It's SolutionExplorer.SyncWithActiveDocument. But I don't see any way to use it in the Customize window, or if it's there I can't find it.

You can directly add commands to a menu only from the existing VS menus.
For additional commands, you can create an intermediate command with my Visual Commander extension DTE.ExecuteCommand("SolutionExplorer.SyncWithActiveDocumen") and then add this VCmd.Command01 command to the menu.

Related

What do I do to make Sublime text stop ignoring filenames that start with a dot

I am using Sublime Text editor and I need to change the settings for Sublime 3 to open files that start with a dot like .gitignore. Please let me know where in the settings I need to make the change. I am using Windows OS fyi.
This isn't a Sublime-specific option, but an operating system one, as the OS determines what is displayed in file dialogs as well as the file system explorer. To set the option on Windows, first open Windows Explorer and navigate to the folder containing the dotfile you want to view. Then, in the View tab, click the Options button on the far right, then select Change folder and search options.
You can also find Options under the File menu.
The Options window will now pop up. Select the View tab, then select the option Show hidden files, folders, and drives. Next, click on the Apply to Folders button at the top.
Similar options are also available on macOS and Linux.

Hotkey to open TFS Source Control Explorer in Visual Studio 2012?

Currently I have to open Team Explorer and click on Source Control Explorer as below snapshot.
I do this very often and need a hotkey for that.
What is it then?
Try with below step:
Go to Options of Tools menu
Select the Keyboard from Environment
Select View.TfsSourceControlExplorer from Show commands containing:. You can type View.TFS in the textbox to filter the list.
Enter your hotkey in Press shorcut keys => click on Assign
Hope it helps!
According to a comment that I found in the site that #Adarsh mentioned, Alt+V,E,S will open the Source Control Explorer. It's a couple extra keystrokes but it works for me!
You can use Ctrl+0,P to open the Pending Changes Window.
You can find all the shortcuts for team Explorer on this blog: http://blogs.msdn.com/b/buckh/archive/2012/06/06/team-explorer-2012-keyboard-shortcuts.aspx
Update:
In Visual Studio 2013 Ctrl+0,P doesn't seem to work to open Pending Changes, but you can use Alt-V,E,H or configure a custom shortcut in the menu Tools/Options/Environment/Keyboard.
Just wanted to share another alternative I learned. One could set an alias in VS Command Window and launch it from there.
alias sce View.TfsSourceControlExplorer
note- 'sce' is an alias of your choice. I generally abbreviate. Obvious but having a pattern will be helpful if you have many of these.
Steps:
Open command window (ctrl+alt+A)
Set the alias (the statement shown
above)
Next time you need to launch the Source Control Explorer,
switch/launch command window and type your alias name. 'sce' in the
above example.
Alt+V,E,S works for me even in VS 2015
In case you like to see more shortcuts, please visit this site
http://visualstudioshortcuts.com
IN VS 2015
Toolbar=>Team=> Manage Connections =>(window like solution explorer will open on right side) Team Explorer- Connect=> Beneath the home symbol ==> Click "Connect"=>Click "Source Control Explorer"

VS2012 : where is custom toolbar command SyncWithActiveDocument?

In Visual Studio 2012, you can create customized toolbars and edit their contents (usually button shortcuts to some IDE commands).
I would like to add the SolutionExplorer.SyncWithActiveDocument command to one of my toolbars, but cannot find it in the list of commands available for addition to the toolbar. In which category is it located? Or is it a command not supported by the toolbar system?
I don't think you can use SyncWithActiveDocument as a command - it is a manual sync that is only active when turning off "Track Active Item in Solution Explorer" in Project and Solutions -> General.
Looking at it this way, is like trying to add auto-sync to a toolbar.

Where is my "Recent Projects and Solutions" option?

I recently installed Visual Studio 2012, and I've been banging my head against my desk looking for missing options.
I use the Recent Projects and Solutions menu option (under the File menu) a lot in Visual Studio 2010, but don't have anything like that in Visual Studio 2012. However, my boss does, so I know there's something wrong with my install or an option I've missed.
I've casually looked through registry settings for anything like "Project" that exists in my 2010 settings but does not exist in my 2012 settings, and came up empty handed. Does anyone know how to fix this?
It looks like some part of the upgrade process just removed this menu option for me. Following nithins link to this question, I followed the instructions the author created to re-create the Recent Projects and Solutions menu item.
For posterity, those steps were (performed in Visual Studio 2012):
Under the Tools menu, click Customize...
Click the Commands tab.
Change the Menu bar selected option in the drop-down list to File.
Click Add New Menu.
Click Modify Selection, rename to Recent Projects and Solutions.
Under the Menu bar drop-down list, select File | Recent Projects and Solutions.
Click Add Command...
(The Add Command menu should appear here.)
Under Categories on the left-hand side, click File.
When the Commands list (on the right-hand side) refreshes, click Recent Project list, and click OK.
Click Close.
Happy project switching!
I had the exact same problem, but I had the sense that other menu items were missing as well.
What I did was go into Tools => Import & Export Settings, choose Reset all settings, and then select the same profile as when I installed Visual Studio. (General Development Settings.) That fixed the issue.

How to add commands to Visual Studio 2012?

How can I add custom commands to the keyboard dialog (Tools->Options->Keyboard) in order to trigger them by shortcuts? Unfortunately, I could not find any resource on the web.
I crossed this blog post, but it's slightly different, because I'd have to create a menu entry. I only want to show the commands in the keyboard dialog. Just like it worked with macros.
I have not checked VS 2012 in this area, but I think it's the same as for previous version.
All that menu and command stuff is localized in a file called [mypackage].vsct which is the Visual Studio Command Table. The schema is described here: VSCT XML Schema Reference. When you used the wizard it probably created one for you.
As you can see in the schema, a Command is always linked somehow to a Menu (Commands Element), but there are a number of flags you can use to tweak this: Command Flag Element. Depending on what you do, I'd try the CommandWellOnly, DefaultInvisible and DynamicVisibility.
Anyway, if you don't want your menu to appear on the top menu bar, just can also just change the <Parent> element of the root <Menu> element in the vsct file.

Resources