├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Default.sublime-commands ├── README.md ├── Main.sublime-menu └── restart.py /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["f5"], "command": "restart" 4 | } 5 | ] -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["f5"], "command": "restart" 4 | } 5 | ] -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["f5"], "command": "restart" 4 | } 5 | ] -------------------------------------------------------------------------------- /Default.sublime-commands: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yedderson/SublimeRestart/HEAD/Default.sublime-commands -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SublimeText Restart 2 | =================== 3 | 4 | Sublime Restart plugin lets you restart Sublime Text with a single keypress. 5 | 6 | 7 | Supported versions and platforms 8 | -------------------------------- 9 | ST2 and ST3 on Windows, Linux, OSX 10 | 11 | 12 | Installation 13 | ------------ 14 | Using SublimeText Package Manager: 15 | type `package install` then look for 'Restart' or manually clone this repo in the Packages directory 16 | 17 | 18 | Usage 19 | ----- 20 | The default key binding for restarting SublimeText is `F5`, a `restart` entry is added to the File menu as well. 21 | 22 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "file", 4 | "children": 5 | [ 6 | { 7 | "id":"Quit", 8 | "command": "restart" 9 | } 10 | ] 11 | }, 12 | { 13 | "caption": "Preferences", 14 | "mnemonic": "n", 15 | "id": "preferences", 16 | "children": 17 | [ 18 | { 19 | "caption": "Package Settings", 20 | "mnemonic": "P", 21 | "id": "package-settings", 22 | "children": 23 | [ 24 | { 25 | "caption": "Restart", 26 | "children": 27 | [ 28 | { 29 | "command": "open_file", "args": 30 | { 31 | "file": "${packages}/Restart/Restart.sublime-settings" 32 | }, 33 | "caption": "Settings – Default" 34 | }, 35 | 36 | { "caption": "-" } 37 | ] 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | ] -------------------------------------------------------------------------------- /restart.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin, os, sys, subprocess 2 | 3 | __author__ = 'Hassen Ben Yeddder' 4 | __email__ = 'hassenbenyedder@gmail.com' 5 | 6 | class RestartCommand(sublime_plugin.TextCommand): 7 | def run(self, edit): 8 | path = sublime.load_settings("Restart.sublime-settings").get("path") 9 | 10 | if sys.platform == 'win32': 11 | if sublime.version()[:1]=='3': 12 | subprocess.call('taskkill /im sublime_text.exe /f && cmd /C "'+ os.path.join(os.getcwd(), 'sublime_text.exe') + '"', shell=True) 13 | else: 14 | os.execl(sys.executable,' ') 15 | elif sys.platform == 'darwin': 16 | #Restarting ST3 on mac 17 | if sublime.version()[:1]=='3': 18 | subprocess.call("pkill subl && "+ os.path.join(os.getcwd(), 'subl'), shell=True) 19 | else: 20 | os.execl(os.path.join(os.getcwd(), 'subl')) 21 | else: 22 | #Restarting ST3 on linux 23 | if sublime.version()[:1]=='3': 24 | subprocess.call("pkill 'sublime_text' && "+ os.path.join(os.getcwd(), 'sublime_text'), shell=True) 25 | 26 | else: 27 | os.execl(os.path.join(os.getcwd(), 'sublime_text')) 28 | --------------------------------------------------------------------------------