Skip to content

Instantly share code, notes, and snippets.

@sligodave
Last active December 23, 2015 00:28
Show Gist options
  • Select an option

  • Save sligodave/6553396 to your computer and use it in GitHub Desktop.

Select an option

Save sligodave/6553396 to your computer and use it in GitHub Desktop.

Revisions

  1. sligodave revised this gist Sep 13, 2013. 4 changed files with 6 additions and 6 deletions.
    2 changes: 1 addition & 1 deletion Default (Linux).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+alt+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    { "keys": ["ctrl+alt+y"], "command": "change_syntax", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    2 changes: 1 addition & 1 deletion Default (OSX).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+super+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    { "keys": ["ctrl+super+y"], "command": "change_syntax", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    2 changes: 1 addition & 1 deletion Default (Windows).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+alt+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    { "keys": ["ctrl+alt+y"], "command": "change_syntax", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    6 changes: 3 additions & 3 deletions SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    import sublime_plugin


    class SyntaxToYamlCommand(sublime_plugin.TextCommand):
    class ChangeSyntaxCommand(sublime_plugin.TextCommand):
    def run(self, edit, syntax='Packages/Text/Plain text.tmLanguage'):
    self.view.set_syntax_file(syntax)


    # class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
    # class ChangeSyntaxToYAMLEventListener(sublime_plugin.EventListener):
    # def on_load(self, view):
    # view.run_command('syntax_to_yaml', args={'syntax': 'Packages/YAML/YAML.tmLanguage'})
    # view.run_command('change_syntax', args={'syntax': 'Packages/YAML/YAML.tmLanguage'})

    # on_new = on_load
  2. sligodave revised this gist Sep 13, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    import sublime_plugin


  3. sligodave revised this gist Sep 13, 2013. 4 changed files with 24 additions and 5 deletions.
    4 changes: 4 additions & 0 deletions Default (Linux).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+alt+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    4 changes: 4 additions & 0 deletions Default (OSX).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+super+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    4 changes: 4 additions & 0 deletions Default (Windows).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    [
    // Change the syntax of the current file to YAML
    { "keys": ["ctrl+alt+y"], "command": "syntax_to_yaml", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}}
    ]
    17 changes: 12 additions & 5 deletions SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,14 @@

    import sublime_plugin

    class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
    def on_load(self, view):
    view.set_syntax_file('Packages/YAML/YAML.tmLanguage')

    on_new = on_load

    class SyntaxToYamlCommand(sublime_plugin.TextCommand):
    def run(self, edit, syntax='Packages/Text/Plain text.tmLanguage'):
    self.view.set_syntax_file(syntax)


    # class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
    # def on_load(self, view):
    # view.run_command('syntax_to_yaml', args={'syntax': 'Packages/YAML/YAML.tmLanguage'})

    # on_new = on_load
  4. sligodave revised this gist Sep 13, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    import sublime_plugin

    class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
    def on_load(self, view):
    view.set_syntax_file('YAML.tmLanguage')
    view.set_syntax_file('Packages/YAML/YAML.tmLanguage')

    on_new = on_load
  5. sligodave revised this gist Sep 13, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    import sublime_plugin

    class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
  6. sligodave created this gist Sep 13, 2013.
    6 changes: 6 additions & 0 deletions SyntaxToYAML.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@

    import sublime_plugin

    class SyntaxToYAMLEventListener(sublime_plugin.EventListener):
    def on_load(self, view):
    view.set_syntax_file('YAML.tmLanguage')