Skip to content

Instantly share code, notes, and snippets.

@eduwass
Created June 8, 2024 10:24
Show Gist options
  • Save eduwass/e04da7e635e4ef731a2148c86127d42a to your computer and use it in GitHub Desktop.
Save eduwass/e04da7e635e4ef731a2148c86127d42a to your computer and use it in GitHub Desktop.
make vscode:// url scheme remap to cursor://

If you use cursor.com this can be useful

duti can be used to directly remap the vscode:// URL scheme to the cursor:// application without the need for an intermediary script.

Steps to Remap URL Scheme Using duti

  1. Install duti (if you haven't already):

    brew install duti
  2. Find the Bundle Identifier for the Cursor Application:

    You'll need the bundle identifier for the Cursor application. You can usually find it by checking the application's Info.plist or by running the following AppleScript command in Terminal:

    osascript -e 'id of application "Cursor"'

    Let's assume the bundle identifier for the Cursor application is com.example.Cursor.

  3. Remap the URL Scheme:

    Use duti to remap the vscode:// URL scheme to the Cursor application. Run the following command in Terminal:

    duti -s com.example.Cursor vscode

    Replace com.example.Cursor with the actual bundle identifier of the Cursor application.

Verify the Remapping

To verify that the remapping is working correctly, you can test it with a vscode:// URL. For example, use the following command in Terminal:

open "vscode://file/somefile.text:123"

This should now open the URL using the Cursor application instead of Visual Studio Code.

@nitsujri
Copy link

com.todesktop.230313mzl4w4u92 is the bundle identifier confirmed by this post: https://forum.cursor.com/t/cursor-bundle-identifier/779

@eduwass
Copy link
Author

eduwass commented Nov 25, 2024

@nitsujri yeah, just be mindful that it is safer to run step #2, as the ID could change in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment