function keyBindingsForPlatform(platform) {
    var osx = platform === 'OSX';
    var ctrl = osx ? META : CTRL;

    if (!cache[platform]) {
      cache[platform] = build(function (bind) {
        bind(A, ctrl, 'selectAll');
        bind(LEFT, null, 'moveLeft');
        bind(LEFT, ALT, 'moveWordLeft');
        bind(LEFT, SHIFT, 'moveLeftAndModifySelection');
        bind(LEFT, ALT | SHIFT, 'moveWordLeftAndModifySelection');
        bind(RIGHT, null, 'moveRight');
        bind(RIGHT, ALT, 'moveWordRight');
        bind(RIGHT, SHIFT, 'moveRightAndModifySelection');
        bind(RIGHT, ALT | SHIFT, 'moveWordRightAndModifySelection');
        bind(UP, null, 'moveUp');
        bind(UP, ALT, 'moveToBeginningOfParagraph');
        bind(UP, SHIFT, 'moveUpAndModifySelection');
        bind(UP, ALT | SHIFT, 'moveParagraphBackwardAndModifySelection');
        bind(DOWN, null, 'moveDown');
        bind(DOWN, ALT, 'moveToEndOfParagraph');
        bind(DOWN, SHIFT, 'moveDownAndModifySelection');
        bind(DOWN, ALT | SHIFT, 'moveParagraphForwardAndModifySelection');
        bind(BACKSPACE, null, 'deleteBackward');
        bind(BACKSPACE, SHIFT, 'deleteBackward');
        bind(BACKSPACE, ALT, 'deleteWordBackward');
        bind(BACKSPACE, ALT | SHIFT, 'deleteWordBackward');
        bind(BACKSPACE, ctrl, 'deleteBackwardToBeginningOfLine');
        bind(BACKSPACE, ctrl | SHIFT, 'deleteBackwardToBeginningOfLine');
        bind(DELETE, null, 'deleteForward');
        bind(DELETE, ALT, 'deleteWordForward');
        bind(TAB, null, 'insertTab');
        bind(TAB, SHIFT, 'insertBackTab');
        bind(ENTER, null, 'insertNewline');
        bind(Z, ctrl, 'undo');

        if (osx) {
          bind(LEFT, META, 'moveToBeginningOfLine');
          bind(LEFT, META | SHIFT, 'moveToBeginningOfLineAndModifySelection');
          bind(RIGHT, META, 'moveToEndOfLine');
          bind(RIGHT, META | SHIFT, 'moveToEndOfLineAndModifySelection');
          bind(UP, META, 'moveToBeginningOfDocument');
          bind(UP, META | SHIFT, 'moveToBeginningOfDocumentAndModifySelection');
          bind(DOWN, META, 'moveToEndOfDocument');
          bind(DOWN, META | SHIFT, 'moveToEndOfDocumentAndModifySelection');
          bind(BACKSPACE, CTRL, 'deleteBackwardByDecomposingPreviousCharacter');
          bind(BACKSPACE, CTRL | SHIFT, 'deleteBackwardByDecomposingPreviousCharacter');
          bind(Z, META | SHIFT, 'redo');
        } else {
          bind(Y, CTRL, 'redo');
        }
      });
    }

    return cache[platform];
  }
Builds a BindingSet based on the current platform.

@param {string} platform A string name of a platform (e.g. "OSX").
@returns {BindingSet} keybindings appropriate for the given platform.