Notice: WC_Cart::get_cart_url is deprecated since version 2.5! Use wc_get_cart_url instead. in /home/wordpre2/public_html/wp-includes/functions.php on line 3831
Select Page

If you are like me, a daily user of Sublime Text 3, then you will find this code snippet very handy. What if you will be able to just right click on a folder and the Explorer Context Menu will have an option to open that folder or file directly in Sublime Text 3?

The bellow code snippet will allow you to do just that. First open your favorite text editor and paste the code snippet bellow:

  
  @echo off
  SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe

  rem add it for all file types
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
  @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f

  rem add it for folders
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
  @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
  pause
  

Make sure that you set the correct path on line 2 the variable st2Path

Save the file with the name OpenWithSublimeText3.bat. If your are running on windows 8.1, to launch the file just right click the file and chose “Run as administrator”.

Run as Administrator
Run as Administrator

If everything is ok you will see the following windows.

Registry has been added
Registry has been added

About author

Young and dedicated fellow, which has playing with WordPress for 5 years now, likes everything about web design and web development.

View all author posts →

Share This