Last active
December 21, 2015 00:09
-
-
Save FokkeZB/6218345 to your computer and use it in GitHub Desktop.
Alloy lay-out for Sublime Text http://withtitanium.com/2013/08/titanium-alloy-optimized-sublime-text-2-layout/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put me in: ~/Library/Application Support/Sublime Text 2/Packages/User/ | |
import sublime, sublime_plugin | |
from os.path import splitext | |
from os.path import isfile | |
class MoveWindowCommand(sublime_plugin.EventListener): | |
def on_load(self, view): | |
window = sublime.active_window() | |
myView = window.active_view() | |
fileName, fileExtension = splitext(view.file_name()) | |
if fileExtension == '.xml': | |
window.set_view_index(myView, 1, 0) | |
elif fileExtension == '.tss': | |
window.set_view_index(myView, 2, 0) | |
elif fileExtension == '.js': | |
window.set_view_index(myView, 0, 0) | |
if isfile(fileName.replace('/controllers/','/views/')+'.xml'): | |
window.open_file(fileName.replace('/controllers/','/views/')+'.xml') | |
if isfile(fileName.replace('/controllers/','/styles/')+'.tss'): | |
sublime.set_timeout( | |
lambda: | |
window.open_file(fileName.replace('/controllers/','/styles/')+'.tss') | |
, 100) | |
else : | |
window.set_view_index(myView, 0, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the .js file was opened I had to add a timeout for the .tss file since the xml file and it opened at the same time and caused an issue