getcursor / cursor

The AI Code Editor
https://cursor.com
25.27k stars 1.57k forks source link

[Feature Request] Open In Cursor (Windows Context Menu) #799

Open DoctorGoose opened 1 year ago

DoctorGoose commented 1 year ago

Similar to Visual Studio Code, could Cursor include an option to add "Open in Cursor" for the Windows Context Menu during installation?

Willaiem commented 11 months ago

Create the cursor.reg file with the content below:

IMPORTANT: replace the <username> with your actual username!

Windows Registry Editor Version 5.00
; Open files
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with Cursor]
@="Edit with Cursor"
"Icon"="C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe,0"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with Cursor\command]
@="\"C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\cursor]
@="Open Folder as Cursor Project"
"Icon"="C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe,0"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\cursor\command]
@="\"C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\cursor]
@="Open Folder as Cursor Project"
"Icon"="C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe,0"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\cursor\command
@="\"C:\\Users\\<username>\\AppData\\Local\\Programs\\cursor\\cursor.exe\" \"%V\""

Double-click it to create the registry entries.

If the options don't appear in the Explorer's context menu then you should restart your system.

Taken from https://stackoverflow.com/questions/37306672/visual-studio-code-open-with-code-does-not-appear-after-right-clicking-a-folde - I just changed the paths and the names to the Cursor ones.

Puliczek commented 2 months ago

I built a powershell script for that:

https://github.com/Puliczek/open-with-cursor-context-menu

yuzhounh commented 1 month ago

Installation: Run install-open-with-cursor.exe with administrator privileges. https://github.com/yuzhounh/Open-with-Cursor