This is the archived version of Roland Weigelt's weblog that ran from 2003 to 2023 at weblogs.asp.net

Archives

Archives / 2018 / April
  • Open Git Bash for Recent Visual Studio [Code] Projects/Folders with Just a Few Keystrokes

    Emaroo is a free utility for browsing most recently used (MRU) lists of a variety of programs for developers and designers.

    Download Emaroo on www.roland-weigelt.de/emaroo.

    Tip: When you pin Emaroo to the taskbar and drag the icon to the left, you can quickly start it by pressing the Windows key and a number (e.g. Win+1 if the icon is in the leftmost position).

    In addition to opening files or folders and a couple of other built-in features, Emaroo also allows used-defined custom actions. A custom action runs an executable of your choice, with arguments and/or a working directory specified using macros similar to those for the pre-build/post-build events in Visual Studio. You execute a custom action either via the context menu or via one of the hotkeys Ctrl+1, …, Ctrl+9, Ctrl+0.

    A Custom Action for Git Bash

    • Copy the following URL (direct link to one of the custom actions available on GitHub):
      https://raw.githubusercontent.com/RWeigelt/EmarooCustomActions/master/git/GitBashHere.action.json
    • Launch Emaroo
    • Open the settings page:
      20180404_SettingsPage
    • Click "Import"
    • Paste the clipboard content into the "File name:" field and press the “Open” button
    • Change to the Visual Studio page
    • You'll find the custom action in the lower left corner…
      20180404_CustomActionInFooter
      …and in the context menus of the list items:
      20180404_ContextMenu
    • Repeat the steps for the other Visual Studio versions and/or Visual Studio Code

    How It’s Done

    Let’s take a look how the custom action is defined:

    • Either open the context menu on the custom action in the lower left corner of the Visual Studio tab…
      20180404_ContextMenuInFooter
      …or, if you are on the settings tab, press the pen icon on the custom action:
      20180404_EditIconInCustomAction
    • This will open the following dialog:
      20180404_EditDialog
    • For the Git Bash custom action,
      • the “Executable” field contains the full path of git-bash.exe,
      • we don’t need anything in the “Arguments” field
      • and we’ll start git-bash.exe in the directory of the currently selected project in the Visual Studio MRU list (using the $(DirPath) macro).

    See also