title: Alphabetically Sort functions Sublime Text 3
body: <p>I have a set of functions defined in a file. They are arbitrarily ordered.</p>
  
  <pre><code>function foo() { 
    // func body
  }
  function bar() { /* func body */ }
  function baz() { /* func body */ }
  </code></pre>
  
  <p>I would like some tool which will reorder them alphabetically by function name, i.e.:</p>
  
  <pre><code>function bar() { /* func body */ }
  function baz() { /* func body */ }
  function foo() { 
    // func body
  }
  </code></pre>
  
  <p>(Note that simply sorting the lines of code alphabetically wont work.)</p>
  
  <p>I'm interested in a general solution to this problem, as well as in my specific case—which is that I'm writing JavaScript and the editor I use is Sublime Text 3.</p>