Last active
December 14, 2015 06:49
-
-
Save blueplanet/5046177 to your computer and use it in GitHub Desktop.
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
import sublime, sublime_plugin | |
import os | |
class AutoSwitchViewTabSizeCommand(sublime_plugin.EventListener): | |
""" Auto switch tab_size with syntax""" | |
# def on_activated(self, view): | |
def on_load(self, view): | |
syntax = view.settings().get('syntax') | |
if syntax.find("Ruby") > 0 or syntax.find("JavaScript") > 0: | |
view.settings().set("tab_size", 2) | |
elif syntax.find("Python") > 0: | |
view.settings().set("tab_size", 6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment