code: function aceInitialized(hook, context){
    var editorInfo = context.editorInfo;
    editorInfo.ace_doInsertHeading = _(doInsertHeading).bind(context);
  }
docs: Once ace is initialized, we set ace_doInsertHeading and bind it to the context