title: Is it possible to chain key binding commands in sublime text 2?
body: <p>There are times in Sublime Text when I want to reveal the current file in the side bar and then navigate around the folder structure. </p>
  
  <p>This can be achieved using the commands <code>reveal_in_side_bar</code> and <code>focus_side_bar</code> however they have to be bound to two separate key combinations so I have to do 2 keyboard combinations to achieve my goal when ideally I'd like just one (I'm lazy). </p>
  
  <p>Is there any way to bind multiple commands to a single key combination? e.g. something like this:</p>
  
  <pre><code>{
    "keys": ["alt+shift+l"], 
    "commands": ["reveal_in_side_bar", "focus_side_bar"]
  },
  </code></pre>
  
  <h2>Solution</h2>
  
  <p>Based on @artem-ivanyk's and @d_rail's answers</p>
  
  <p><strong>1) Tools → New Plugin</strong></p>
  
  <pre><code>import sublime, sublime_plugin
  
  class RevealInSideBarAndFocusCommand(sublime_plugin.WindowCommand):
      def run(self):
          self.window.run_command("reveal_in_side_bar")
          self.window.run_command("focus_side_bar")
  </code></pre>
  
  <p>Save as RevealInSideBarAndFocus.py</p>
  
  <p><strong>2) Sublime Text 2 → Preferences → Key Bindings — User</strong></p>
  
  <p>Bind it to shortcut:</p>
  
  <pre><code>{ "keys": ["alt+shift+l"], "command": "reveal_in_side_bar_and_focus" }
  </code></pre>