Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alejandro-martin/e882767cc4c6b419c9969b9182ca0b41 to your computer and use it in GitHub Desktop.
Save alejandro-martin/e882767cc4c6b419c9969b9182ca0b41 to your computer and use it in GitHub Desktop.
Add "Open with Sublime Text" Windows action to right click

Add "Open with Sublime Text" windows action to right click

Create a sublime-text-option.reg, save it and execute it:

Windows Registry Editor Version 5.00

; Option will appear when you right click on a file
[HKEY_CLASSES_ROOT\*\shell\sublime]
@="Open with &Sublime"
"Icon"="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\*\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\" \"%1\""

; ; Option will appear when you right click ON a folder
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder with &Sublime"
"Icon"="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\" \"%1\""


; ; ; Option will appear when you right click INSIDE a folder
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime]
@="Open Folder with &Sublime"
"Icon"="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text\\sublime_text.exe\" \"%V\""

; "Icon" line can be removed if you don't want the icon to appear

It will add on the Windows menu:

  • Open with Sublime if you right click on a file
  • Open Folder with Sublime if you right click on a folder
  • Open Folder with Sublime if you right click inside a folder

Sources:

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