Today I Learned: How to handle Jetbrains Toolbox URLs in Windows

I use Obsidian, and being able to jump from a Task there right into a chunk o' code would be nice.

In IntelliJ, you can right click a file and choose: Copy Path/Reference, and then Toolbox URL. However, Windows doesn't know how to open those. You can teach it, though.

To set Windows 11 to open a URL with the "jetbrains://idea/navigate" scheme in IntelliJ IDEA Ultimate, you'll need to register the custom URL scheme in the Windows registry. Here are the steps:

  1. Open the Registry Editor:

    • Press Win + R, type regedit, and press Enter.
  2. Navigate to the URL Protocols:

    • Go to HKEY_CLASSES_ROOT.
  3. Create a New Key:

    • Right-click on HKEY_CLASSES_ROOT, select New > Key, and name it jetbrains.
  4. Set the Default Value:

    • Select the jetbrains key, and in the right pane, double-click on the (Default) value. Set it to URL:JetBrains Protocol.
  5. Create a URL Protocol String:

    • Right-click on the jetbrains key, select New > String Value, and name it URL Protocol. Leave its value empty.
  6. Create a Shell Key:

    • Right-click on the jetbrains key, select New > Key, and name it shell.
  7. Create an Open Key:

    • Right-click on the shell key, select New > Key, and name it open.
  8. Create a Command Key:

    • Right-click on the open key, select New > Key, and name it command.
  9. Set the Command Value:

    • Select the command key, and in the right pane, double-click on the (Default) value. Set it to the path of your IntelliJ IDEA executable, followed by the URL parameter. For example: "C:\Program Files\JetBrains\IntelliJ IDEA 2023.1\bin\idea64.exe" "%1"

After completing these steps, Windows should recognize the jetbrains://idea/navigate URL scheme and open it with IntelliJ IDEA Ultimate.

Thanks again Copilot.