Skip to content

Instantly share code, notes, and snippets.

key.setViewKey("g",
function () { goDoCommand('cmd_scrollTop'); },
"ページ先頭へ移動");
key.setViewKey("M-<",
function () { goDoCommand('cmd_scrollTop'); },
"ページ先頭へ移動");
key.setViewKey(["ESC", "<"],
function () { goDoCommand('cmd_scrollTop'); },
key.setViewKey([["g"],
["M-<"],
["ESC", "<"]],
function () { goDoCommand('cmd_scrollTop'); },
"ページ先頭へ移動");
// ==================== global mode ==================== //
key.setGlobalKey(["C-x", "k"],
function () { BrowserCloseTabOrWindow(); },
"Close tab / window");
key.setGlobalKey(["C-x", "K"],
function () { closeWindow(true); },
"Close the window");
@mooz
mooz / mgetr.user.js
Created August 24, 2009 16:42
Make Google Reader easy to read
// ==UserScript==
// @name mgetr
// @namespace mooz
// @description Make Google Reader easy to read
// @include http://www.google.tld/reader/view/*
// ==/UserScript==
(function () {
var css =
// ==== misc ==== //
@mooz
mooz / gist:174712
Created August 25, 2009 14:37
Emacs-like string rectangle commans
key.setEditKey(["C-x", "r", "d"],
function (aEvent, aArg) {
command.replaceRectangle(aEvent.originalTarget, "", false, !aArg);
}, "Delete text in the region-rectangle", true);
key.setEditKey(["C-x", "r", "t"],
function (aEvent) {
var replacement = window.prompt("String rectangle", "");
command.replaceRectangle(aEvent.originalTarget, replacement);
}, "Replace text in the region-rectangle with user inputted string", true);
@mooz
mooz / gist:180866
Created September 4, 2009 12:54
キーボードでタブを移動
key.setViewKey("H",
function () {
if (gBrowser.mCurrentTab.previousSibling)
gBrowser.moveTabTo(gBrowser.mCurrentTab, gBrowser.mCurrentTab._tPos - 1);
else
gBrowser.moveTabTo(gBrowser.mCurrentTab, gBrowser.mTabContainer.childNodes.length - 1);
},
"選択中のタブを右へ移動");
key.setViewKey("L",
(defun my-c-mode-hook ()
(c-subword-mode)
(setq c-basic-offset 4)
(local-set-key
"{"
'(lambda ()
(interactive)
(let (begin
end)
(setq begin (point))
#!/bin/sh
for i in *.sqlite
do
before=`wc -c $i | sed 's/[ ].*$//'`
sqlite3 $i vacuum
sqlite3 $i reindex
after=`wc -c $i | sed 's/[ ].*$//'`
percentage=`echo "(100.0 * $after) / $before" | bc`
key.setGlobalKey(["C-c", "C-f"],
function () {
var toolbox = document.getElementById("navigator-toolbox");
toolbox.hidden = !toolbox.hidden;
},
"擬似フルスクリーン状態の切り替え");
key.setViewKey(":",
function () { command.interpreter(); },
"インタプリタ");
key.setEditKey("C-y", command.yank, "貼り付け");
key.setEditKey("M-y", command.yankPop, "以前にコピーしたテキストを順に貼り付け");
key.setEditKey("C-M-y", function (aEvent) {
if (!command.kill.ring.length)
return;
var clipboardText = command.getClipboardText();
if (!command.kill.ring.length || clipboardText != command.kill.ring[0]) {
command.pushKillRing(clipboardText);
}