Helper class to launch Sublime
<?php | |
class Sublime | |
{ | |
/** | |
* Sublime shell command | |
*/ | |
const COMMAND = 'subl'; | |
/** | |
* Launch sublime and open file | |
* | |
* @param string $file | |
* @return void | |
*/ | |
public static function openFile($file) | |
{ | |
exec(self::COMMAND .' '. $file); | |
} | |
/** | |
* Get Sublime file url (clickable URL from the browser) | |
* | |
* @param string $file | |
* @return string | |
*/ | |
public static function fileUrl($file) | |
{ | |
return self::COMMAND . '://open?url=file://' . $file; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Just make sure
subl
is in your$PATH
. Although if you follow this tutorial, the command sould besublime
http://olivierlacan.com/posts/launch-sublime-text-3-from-the-command-line/