Skip to content

Instantly share code, notes, and snippets.

@mooz
Created August 17, 2009 14:29
Show Gist options
  • Save mooz/169146 to your computer and use it in GitHub Desktop.
Save mooz/169146 to your computer and use it in GitHub Desktop.
// ==================== global mode ==================== //
key.setGlobalKey(["C-x", "k"],
function () { BrowserCloseTabOrWindow(); },
"Close tab / window");
key.setGlobalKey(["C-x", "K"],
function () { closeWindow(true); },
"Close the window");
// ==================== view mode ==================== //
key.setViewKey([["g"],
["M-<"]],
function () { goDoCommand('cmd_scrollTop'); },
"Scroll to the top of the page");
key.setViewKey([["G"],
["M->"]],
function () { goDoCommand('cmd_scrollBottom'); },
"Scroll to the bottom of the page");
// ==================== edit mode ==================== //
key.setEditKey([["C-SPC"],
["C-@"]],
function (aEvent) { command.setMark(aEvent); },
"Set the mark");
// ==================== caret mode ==================== //
key.setCaretKey("J", function () {
util.getSelectionController().scrollLine(true);
}, "Scroll line down");
key.setCaretKey("K", function () {
util.getSelectionController().scrollLine(false);
}, "Scroll line up");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment