Skip to content

Instantly share code, notes, and snippets.

@mittalyashu
Last active May 21, 2021 06:11
Show Gist options
  • Save mittalyashu/5c1525ba0c32333342096497a989c604 to your computer and use it in GitHub Desktop.
Save mittalyashu/5c1525ba0c32333342096497a989c604 to your computer and use it in GitHub Desktop.
Helps to open your files and folders in Sublime Text 1, 2, 3

NOTE: This is for windows users.

Open regedit.exe

FOR FOLDERS

Navigate to this key using the tree on the right: HKEY_CLASSES_ROOT\Directory\shell\

Create a new key in the shell key with any name like: Sublime or Open with Sublime Text or Sublime Text

There will be a key with a Name: (Default) and enter the Data: Open as Sublime Project

Create a new Binary Value with Name: Icon and enter the Data: C:\Program Files\Sublime Text 3\sublime_text.exe (Make sure you change the version of the Sublime Text you are using)

Create a new key in the key name (Sublime or Open with Sublime Text or Sublime Text) with Name: command

There will be a key (in that command key) with a Name: (Default) and enter the (Choose any one of the option below)

  1. Data: C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1" (If you want to open the project in new sublime window)
  2. Data: C:\Program Files\Sublime Text 3\sublime_text.exe "%1" (If you want to open the project in sublime window, which is already running or you are currently using)

FOR FILES

Navigate to this key using the tree on the right: HKEY_CLASSES_ROOT\*\shell\

Create a new key in the shell key with any name like: Sublime or Open with Sublime Text or Sublime Text

There will be a key with a Name: (Default) and enter the Data: Open with Sublime

Create a new Binary Value with Name: Icon and enter the Data: C:\Program Files\Sublime Text 3\sublime_text.exe (Make sure you change the version of the Sublime Text you are using)

Create a new key in the key name (Sublime or Open with Sublime Text or Sublime Text) with Name: command

There will be a key (in that command key) with a Name: (Default) and enter the (Choose any one of the option below)

  1. Data: C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1" (If you want to open the file in new sublime window)
  2. Data: C:\Program Files\Sublime Text 3\sublime_text.exe "%1" (If you want to open the file in sublime window, which is already running or you are currently using)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment