Created
September 27, 2018 06:26
-
-
Save ncaq/4836c2345b21345fd72f3e1b0647c660 to your computer and use it in GitHub Desktop.
今はXULアドオン消滅でもう使えないkeysnailの最終設定ファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================== KeySnail Init File =========================== // | |
// この領域は, GUI により設定ファイルを生成した際にも引き継がれます | |
// 特殊キー, キーバインド定義, フック, ブラックリスト以外のコードは, この中に書くようにして下さい | |
// ========================================================================= // | |
//{{%PRESERVE% | |
plugins.options["hok.hint_keys"] = "htnsdcrbmwvz"; | |
plugins.options["hok.hint_base_style"] = { | |
"font-family": "monospace", | |
"font-size": "small", | |
"font-weight": "bold", | |
"line-height": "small", | |
"text-transform": "lowercase", | |
"z-index": "2147483647", | |
color: "#000", | |
left: "0", | |
margin: "0px", | |
padding: "0px", | |
position: "fixed", | |
top: "0" | |
}; | |
plugins.options["history.max-results"] = 10000; | |
plugins.options["kkk.sites"] = [ | |
"^https?://([0-9a-zA-Z]+\\.)?4chan\\.org/", | |
"^https?://([0-9a-zA-Z]+\\.)?crates\\.io/", | |
"^https?://([0-9a-zA-Z]+\\.)?dashnet.org/cookieclicker/", | |
"^https?://([0-9a-zA-Z]+\\.)?github\\.com/", | |
"^https?://([0-9a-zA-Z]+\\.)?github\\.io/", | |
"^https?://([0-9a-zA-Z]+\\.)?haskell\\.org/", | |
"^https?://([0-9a-zA-Z]+\\.)?rust-lang\\.org/", | |
"^https?://([0-9a-zA-Z]+\\.)?stackage\\.org/", | |
"^https?://([0-9a-zA-Z]+\\.)?twitter\\.com/", | |
"^https?://react.semantic-ui.com/" | |
]; | |
plugins.options["site_local_keymap.local_keymap"] = { | |
"^http://www.pixiv.net": [ | |
[";", null], | |
["b", null], | |
["d", null], | |
["i", null], | |
["j", null], | |
["k", null], | |
["n", null], | |
["t", null], | |
["x", null] | |
] | |
}; | |
//}}%PRESERVE% | |
// ========================================================================= // | |
// ========================= Special key settings ========================== // | |
key.quitKey = "C-g"; | |
key.helpKey = "M-c"; | |
key.escapeKey = "C-`"; | |
key.macroStartKey = "<f3>"; | |
key.macroEndKey = "<f4>"; | |
key.universalArgumentKey = "Not defined"; | |
key.negativeArgument1Key = "Not defined"; | |
key.negativeArgument2Key = "Not defined"; | |
key.negativeArgument3Key = "Not defined"; | |
key.suspendKey = "Not defined"; | |
// ================================= Hooks ================================= // | |
hook.setHook("KeyBoardQuit", function(aEvent) { | |
if (key.currentKeySequence.length) return; | |
command.closeFindBar(); | |
let marked = command.marked(aEvent); | |
if (util.isCaretEnabled()) { | |
if (marked) { | |
command.resetMark(aEvent); | |
} else { | |
if ("blur" in aEvent.target) aEvent.target.blur(); | |
gBrowser.focus(); | |
_content.focus(); | |
} | |
} else { | |
goDoCommand("cmd_selectNone"); | |
} | |
if (KeySnail.windowType === "navigator:browser" && !marked) { | |
key.generateKey(aEvent.originalTarget, KeyEvent.DOM_VK_ESCAPE, true); | |
} | |
}); | |
// ============================= Key bindings ============================== // | |
key.setGlobalKey( | |
"M-x", | |
function(ev, arg) { | |
ext.select(arg, ev); | |
}, | |
"エクステ一覧表示", | |
true | |
); | |
key.setGlobalKey( | |
"M-:", | |
function(ev) { | |
command.interpreter(); | |
}, | |
"JavaScript のコードを評価", | |
true | |
); | |
key.setGlobalKey( | |
["M-c", "b"], | |
function(ev) { | |
key.listKeyBindings(); | |
}, | |
"キーバインド一覧を表示" | |
); | |
key.setGlobalKey( | |
["M-c", "f"], | |
function(ev) { | |
openHelpLink("firefox-help"); | |
}, | |
"Firefox のヘルプを表示" | |
); | |
key.setGlobalKey( | |
"C-m", | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_RETURN, true); | |
}, | |
"リターンコードを生成" | |
); | |
key.setGlobalKey( | |
["C-x", "C-c"], | |
function(ev) { | |
closeWindow(true); | |
}, | |
"ウィンドウを閉じる" | |
); | |
key.setGlobalKey( | |
["C-x", "C-f"], | |
function(ev) { | |
BrowserOpenFileWindow(); | |
}, | |
"ファイルを開く", | |
true | |
); | |
key.setGlobalKey( | |
["C-x", "C-s"], | |
function(ev) { | |
saveDocument(window.content.document); | |
}, | |
"ファイルを保存", | |
true | |
); | |
key.setGlobalKey( | |
["C-x", "C-C"], | |
function(ev) { | |
command.restartApp(); | |
}, | |
"Firefox を再起動" | |
); | |
key.setGlobalKey( | |
["C-x", "w"], | |
function(ev) { | |
var browser = getBrowser(); | |
var tabs = browser.mTabContainer.childNodes; | |
for (var i = tabs.length - 1; tabs[i] != browser.selectedTab; i--) | |
browser.removeTab(tabs[i]); | |
}, | |
"右側のタブを全て閉じる", | |
true | |
); | |
key.setGlobalKey( | |
["C-x", "q"], | |
function(ev) { | |
var browser = getBrowser(); | |
var tabs = browser.mTabContainer.childNodes; | |
for (var i = tabs.length - 1; tabs[i] != browser.mCurrentTab; i--); | |
for (i--; i >= 0; i--) browser.removeTab(tabs[i]); | |
}, | |
"左側のタブを全て閉じる", | |
true | |
); | |
key.setGlobalKey( | |
["C-x", "h"], | |
function(ev) { | |
goDoCommand("cmd_selectAll"); | |
}, | |
"すべて選択", | |
true | |
); | |
key.setGlobalKey( | |
["C-x", "C-e"], | |
function(ev) { | |
userscript.reload(); | |
}, | |
"設定ファイルを再読み込み" | |
); | |
key.setGlobalKey( | |
"C-q", | |
function(ev) { | |
BrowserCloseTabOrWindow(); | |
}, | |
"タブ / ウィンドウを閉じる" | |
); | |
key.setGlobalKey( | |
"M-q", | |
function(ev) { | |
TreeStyleTabService.removeTabSubtree(gBrowser.selectedTab, true); | |
}, | |
"ツリーを閉じる" | |
); | |
key.setGlobalKey( | |
"C-M-q", | |
function(ev) { | |
MultipleTabService.closeSimilarTabsOf(gBrowser.selectedTab, null, true); | |
}, | |
"似たタブを全て閉じる" | |
); | |
key.setGlobalKey( | |
"M-w", | |
function(ev) { | |
command.copyRegion(ev); | |
}, | |
"選択中のテキストをコピー", | |
true | |
); | |
key.setGlobalKey( | |
"<f12>", | |
function(ev, arg) { | |
KeySnail.openPreference(); | |
}, | |
"open_preference", | |
true | |
); | |
key.setGlobalKey( | |
"S-<f12>", | |
function(ev, arg) { | |
KeySnail.modules.userscript.openPluginManager(); | |
}, | |
"open_plugin_manager", | |
true | |
); | |
key.setGlobalKey( | |
"M-l", | |
function(ev, arg) { | |
command.setClipboardText(content.location.href); | |
}, | |
"copy_document_url" | |
); | |
key.setGlobalKey( | |
"C-=", | |
function(ev) { | |
FullZoom.reset(); | |
}, | |
"テキストサイズをリセット" | |
); | |
key.setGlobalKey( | |
"C-c", | |
function(ev) { | |
command.copyRegion(ev); | |
}, | |
"選択中のテキストをコピー" | |
); | |
key.setGlobalKey( | |
"C-^", | |
function(ev) { | |
// original code by gomita-san | |
var uri = getBrowser().currentURI; | |
if (uri.path == "/") return; | |
var pathList = uri.path.split("/"); | |
if (!pathList.pop()) pathList.pop(); | |
loadURI(uri.prePath + pathList.join("/") + "/"); | |
}, | |
"Go upper directory" | |
); | |
key.setGlobalKey( | |
[["M-o"], ["M--"]], | |
function(ev) { | |
undoCloseTab(); | |
}, | |
"閉じたタブを元に戻す" | |
); | |
key.setGlobalKey("C-;", function(ev) {}, "Disable"); | |
key.setGlobalKey( | |
"C-o", | |
function(ev) { | |
BrowserOpenTab(); | |
}, | |
"タブを開く" | |
); | |
key.setGlobalKey( | |
"C-i", | |
function(ev) { | |
command.focusElement(command.elementsRetrieverTextarea, 0); | |
}, | |
"最初のインプットエリアへフォーカス", | |
true | |
); | |
key.setGlobalKey( | |
"C-M-c", | |
function(ev, arg) { | |
ext.exec("open-document-in-chromium", arg, ev); | |
}, | |
"open document in chromium", | |
true | |
); | |
key.setGlobalKey( | |
"C-L", | |
function(ev, arg) { | |
command.setClipboardText( | |
`[${content.document.title}]: ${content.location.href}` | |
); | |
}, | |
"copy_document_url_split" | |
); | |
key.setGlobalKey( | |
"C-M-l", | |
function(ev, arg) { | |
command.setClipboardText( | |
`[${content.document.title}](${content.location.href})` | |
); | |
}, | |
"copy_document_url_markdown" | |
); | |
key.setGlobalKey( | |
"C-R", | |
function(ev) { | |
BrowserReloadSkipCache(); | |
}, | |
"更新(キャッシュを無視)" | |
); | |
key.setGlobalKey( | |
"C-M-i", | |
function(ev) { | |
BrowserPageInfo(); | |
}, | |
"ページ情報表示" | |
); | |
key.setGlobalKey( | |
"C-f", | |
function(ev) { | |
command.iSearchForwardKs(ev); | |
}, | |
"Emacs ライクなインクリメンタル検索", | |
true | |
); | |
key.setViewKey( | |
"M-h", | |
function(ev) { | |
let browser = getBrowser(); | |
if (browser.mCurrentTab.previousSibling) { | |
browser.moveTabTo(browser.mCurrentTab, browser.mCurrentTab._tPos - 1); | |
} else { | |
browser.moveTabTo( | |
browser.mCurrentTab, | |
browser.mTabContainer.childNodes.length - 1 | |
); | |
} | |
}, | |
"選択中のタブを左へ" | |
); | |
key.setViewKey( | |
"M-s", | |
function(ev) { | |
let browser = getBrowser(); | |
if (browser.mCurrentTab.nextSibling) { | |
browser.moveTabTo(browser.mCurrentTab, browser.mCurrentTab._tPos + 1); | |
} else { | |
browser.moveTabTo(browser.mCurrentTab, 0); | |
} | |
}, | |
"選択中のタブを右へ" | |
); | |
key.setViewKey( | |
"d", | |
function(ev) { | |
gBrowser.treeStyleTab.detachTab(gBrowser.mCurrentTab); | |
}, | |
"選択中のタブを親タブのサブツリーから切り離す" | |
); | |
key.setViewKey( | |
"'", | |
function(ev, arg) { | |
var maybeUrl = command.getClipboardText(true); | |
TreeStyleTabService.readyToOpenChildTabNow(gBrowser.mCurrentTab, false); | |
gBrowser.loadOneTab( | |
maybeUrl.indexOf("://") === -1 | |
? util.format( | |
"https://www.google.co.jp/search?q=%s", | |
encodeURIComponent(maybeUrl) | |
) | |
: maybeUrl | |
); | |
}, | |
"open_url_from_selection_clipboard_in_tree" | |
); | |
key.setViewKey( | |
"C-'", | |
function(ev, arg) { | |
TreeStyleTabService.readyToOpenChildTabNow(gBrowser.mCurrentTab, false); | |
gBrowser.loadOneTab( | |
util.format( | |
"https://eowf.alc.co.jp/search?q=%s", | |
encodeURIComponent(command.getClipboardText(true)) | |
) | |
); | |
}, | |
"goto_alc_from_selection_clipboard_in_tree" | |
); | |
key.setViewKey( | |
"^", | |
function(ev) { | |
// original code by gomita-san | |
var uri = getBrowser().currentURI; | |
if (uri.path == "/") return; | |
var pathList = uri.path.split("/"); | |
if (!pathList.pop()) pathList.pop(); | |
loadURI(uri.prePath + pathList.join("/") + "/"); | |
}, | |
"一つ上のディレクトリへ移動" | |
); | |
key.setViewKey( | |
"b", | |
function(ev) { | |
gBrowser.selectedTab = TreeStyleTabService.getParentTab( | |
gBrowser.selectedTab | |
); | |
}, | |
"一つ上のツリーに移動" | |
); | |
key.setViewKey( | |
[["h"], ["a"]], | |
function(ev) { | |
getBrowser().mTabContainer.advanceSelectedTab(-1, true); | |
}, | |
"ひとつ左のタブへ" | |
); | |
key.setViewKey( | |
"m", | |
function(aEvent, aArg) { | |
ext.exec("hok-start-extended-mode", aArg); | |
}, | |
"HoK - 拡張ヒントモード", | |
true | |
); | |
key.setViewKey( | |
"g", | |
function(aEvent, aArg) { | |
ext.exec("hok-start-foreground-mode", aArg); | |
}, | |
"Hit a Hint を開始", | |
true | |
); | |
key.setViewKey( | |
[["e"], ["s"]], | |
function(ev) { | |
getBrowser().mTabContainer.advanceSelectedTab(1, true); | |
}, | |
"ひとつ右のタブへ" | |
); | |
key.setViewKey( | |
[["C-n"], ["j"], ["n"], ["C-j"]], | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_DOWN, true); | |
}, | |
"一行スクロールダウン" | |
); | |
key.setViewKey( | |
[["k"], ["t"], ["C-t"], ["C-k"]], | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_UP, true); | |
}, | |
"一行スクロールアップ" | |
); | |
key.setViewKey( | |
"C-s", | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_RIGHT, true); | |
}, | |
"右へスクロール" | |
); | |
key.setViewKey( | |
".", | |
function(ev) { | |
goDoCommand("cmd_scrollBottom"); | |
}, | |
"ページ末尾へ移動" | |
); | |
key.setViewKey( | |
"x", | |
function(ev, arg) { | |
ext.exec("history-show", arg, ev); | |
}, | |
"History - リストを表示", | |
true | |
); | |
key.setViewKey( | |
",", | |
function(ev) { | |
goDoCommand("cmd_scrollTop"); | |
}, | |
"ページ先頭へ移動" | |
); | |
key.setViewKey( | |
[["M-v"], ["z"], ["C-z"]], | |
function(ev) { | |
goDoCommand("cmd_scrollPageUp"); | |
}, | |
"一画面分スクロールアップ" | |
); | |
key.setViewKey( | |
[["C-v"], ["v"], ["M-z"]], | |
function(ev) { | |
goDoCommand("cmd_scrollPageDown"); | |
}, | |
"一画面スクロールダウン" | |
); | |
key.setViewKey( | |
"M-<", | |
function(ev) { | |
goDoCommand("cmd_scrollTop"); | |
}, | |
"ページ先頭へ移動", | |
true | |
); | |
key.setViewKey( | |
"M->", | |
function(ev) { | |
goDoCommand("cmd_scrollBottom"); | |
}, | |
"ページ末尾へ移動", | |
true | |
); | |
key.setViewKey( | |
"H", | |
function(ev) { | |
BrowserBack(); | |
}, | |
"戻る" | |
); | |
key.setViewKey( | |
"S", | |
function(ev) { | |
BrowserForward(); | |
}, | |
"進む" | |
); | |
key.setViewKey( | |
"M-t", | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverButton, true, true); | |
}, | |
"次のボタンへフォーカスを当てる" | |
); | |
key.setViewKey( | |
"M-n", | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverButton, false, true); | |
}, | |
"前のボタンへフォーカスを当てる" | |
); | |
key.setViewKey( | |
[["q"], ["w"]], | |
function(ev) { | |
BrowserCloseTabOrWindow(); | |
}, | |
"タブ / ウィンドウを閉じる" | |
); | |
key.setViewKey( | |
"r", | |
function(ev) { | |
BrowserReload(); | |
}, | |
"更新" | |
); | |
key.setViewKey( | |
[["l"], ["i"]], | |
function(ev) { | |
command.focusToById("urlbar"); | |
}, | |
"ロケーションバーへフォーカス", | |
true | |
); | |
key.setViewKey( | |
":", | |
function(ev, arg) { | |
shell.input(null, arg); | |
}, | |
"コマンドの実行", | |
true | |
); | |
key.setViewKey( | |
"u", | |
function(ev, arg) { | |
ext.exec("scrollet-scroll-document-up", arg, ev); | |
}, | |
"半画面スクロールアップ", | |
true | |
); | |
key.setViewKey( | |
"o", | |
function(ev, arg) { | |
ext.exec("scrollet-scroll-document-down", arg, ev); | |
}, | |
"半画面スクロールダウン", | |
true | |
); | |
key.setViewKey( | |
"C-h", | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_LEFT, true); | |
}, | |
"左へスクロール" | |
); | |
key.setViewKey( | |
"c", | |
function(ev, arg) { | |
ext.exec("hok-start-background-mode", arg, ev); | |
}, | |
"Start Hit a Hint background mode", | |
true | |
); | |
key.setViewKey( | |
"-", | |
function(ev) { | |
undoCloseTab(); | |
}, | |
"閉じたタブを元に戻す" | |
); | |
key.setViewKey( | |
"f", | |
function(ev, arg) { | |
ext.exec("hok-start-private-mode", arg, ev); | |
}, | |
"HoK - リンクをプライベートウィンドウで開く", | |
true | |
); | |
key.setEditKey( | |
["C-x", "b"], | |
function(ev) { | |
command.selectAll(ev); | |
}, | |
"全て選択", | |
true | |
); | |
key.setEditKey( | |
["C-x", "r", "d"], | |
function(ev, arg) { | |
command.replaceRectangle(ev.originalTarget, "", false, !arg); | |
}, | |
"矩形削除", | |
true | |
); | |
key.setEditKey( | |
["C-x", "r", "p"], | |
function(ev) { | |
prompt.read( | |
"String rectangle: ", | |
function(aStr, aInput) { | |
command.replaceRectangle(aInput, aStr); | |
}, | |
ev.originalTarget | |
); | |
}, | |
"矩形置換", | |
true | |
); | |
key.setEditKey( | |
["C-x", "r", "o"], | |
function(ev) { | |
command.openRectangle(ev.originalTarget); | |
}, | |
"矩形行空け", | |
true | |
); | |
key.setEditKey( | |
["C-x", "r", "k"], | |
function(ev, arg) { | |
command.kill.buffer = command.killRectangle(ev.originalTarget, !arg); | |
}, | |
"矩形キル", | |
true | |
); | |
key.setEditKey( | |
["C-x", "r", "y"], | |
function(ev) { | |
command.yankRectangle(ev.originalTarget, command.kill.buffer); | |
}, | |
"矩形ヤンク", | |
true | |
); | |
key.setEditKey( | |
["C-x", "h"], | |
function(ev) { | |
command.selectAll(ev); | |
}, | |
"全て選択" | |
); | |
key.setEditKey( | |
[["C-/"], ["C-_"]], | |
function(ev) { | |
display.echoStatusBar("Undo!", 2000); | |
goDoCommand("cmd_undo"); | |
}, | |
"アンドゥ" | |
); | |
key.setEditKey( | |
[["C-SPC"], ["C-@"]], | |
function(ev) { | |
command.setMark(ev); | |
}, | |
"マークをセット", | |
true | |
); | |
key.setEditKey( | |
"C-?", | |
function(ev) { | |
display.echoStatusBar("Redo!", 2000); | |
goDoCommand("cmd_redo"); | |
}, | |
"リドゥ" | |
); | |
key.setEditKey( | |
"C-a", | |
function(ev) { | |
command.beginLine(ev); | |
}, | |
"行頭へ移動" | |
); | |
key.setEditKey( | |
"C-e", | |
function(ev) { | |
command.endLine(ev); | |
}, | |
"行末へ" | |
); | |
key.setEditKey( | |
"C-s", | |
function(ev) { | |
command.nextChar(ev); | |
}, | |
"一文字右へ移動" | |
); | |
key.setEditKey( | |
"C-h", | |
function(ev) { | |
command.previousChar(ev); | |
}, | |
"一文字左へ移動" | |
); | |
key.setEditKey( | |
"M-s", | |
function(ev) { | |
command.forwardWord(ev); | |
}, | |
"一単語右へ移動" | |
); | |
key.setEditKey( | |
[["C-<backspace>"], ["M-<delete>"], ["M-b"]], | |
function(ev) { | |
command.deleteBackwardWord(ev); | |
}, | |
"前の一単語を削除" | |
); | |
key.setEditKey( | |
"C-n", | |
function(ev) { | |
command.nextLine(ev); | |
}, | |
"一行下へ" | |
); | |
key.setEditKey( | |
"C-t", | |
function(ev) { | |
command.previousLine(ev); | |
}, | |
"一行上へ" | |
); | |
key.setEditKey( | |
[["C-v"], ["M-z"]], | |
function(ev) { | |
command.pageDown(ev); | |
}, | |
"一画面分下へ" | |
); | |
key.setEditKey( | |
[["M-v"], ["C-z"]], | |
function(ev) { | |
command.pageUp(ev); | |
}, | |
"一画面分上へ" | |
); | |
key.setEditKey( | |
"M-<", | |
function(ev) { | |
command.moveTop(ev); | |
}, | |
"テキストエリア先頭へ" | |
); | |
key.setEditKey( | |
"M->", | |
function(ev) { | |
command.moveBottom(ev); | |
}, | |
"テキストエリア末尾へ" | |
); | |
key.setEditKey( | |
"C-d", | |
function(ev) { | |
goDoCommand("cmd_deleteCharForward"); | |
}, | |
"次の一文字削除" | |
); | |
key.setEditKey( | |
"C-b", | |
function(ev) { | |
goDoCommand("cmd_deleteCharBackward"); | |
}, | |
"前の一文字を削除" | |
); | |
key.setEditKey( | |
"M-d", | |
function(ev) { | |
command.deleteForwardWord(ev); | |
}, | |
"次の一単語を削除" | |
); | |
key.setEditKey( | |
"M-c", | |
function(ev, arg) { | |
command.wordCommand( | |
ev, | |
arg, | |
command.capitalizeForwardWord, | |
command.capitalizeBackwardWord | |
); | |
}, | |
"次の一単語をキャピタライズ" | |
); | |
key.setEditKey( | |
"C-k", | |
function(ev) { | |
command.killLine(ev); | |
}, | |
"カーソルから先を一行カット (Kill line)" | |
); | |
key.setEditKey("C-y", command.yank, "貼り付け (Yank)"); | |
key.setEditKey( | |
"M-y", | |
function(ev, arg) { | |
ext.exec("show-kill-ring-and-select-text-to-paste", arg, ev); | |
}, | |
"以前にコピーしたテキスト一覧から選択して貼り付け", | |
true | |
); | |
key.setEditKey( | |
"C-M-y", | |
function(ev) { | |
if (!command.kill.ring.length) return; | |
var ct = | |
command.getClipboardText()( | |
!command.kill.ring.length || ct != command.kill.ring[0] | |
) && command.pushKillRing(ct); | |
prompt.selector({ | |
message: "Paste:", | |
collection: command.kill.ring, | |
callback: function(i) { | |
if (i >= 0) key.insertText(command.kill.ring[i]); | |
} | |
}); | |
}, | |
"以前にコピーしたテキスト一覧から選択して貼り付け", | |
true | |
); | |
key.setEditKey( | |
"C-w", | |
function(ev) { | |
goDoCommand("cmd_copy"); | |
goDoCommand("cmd_delete"); | |
command.resetMark(ev); | |
}, | |
"選択中のテキストを切り取り (Kill region)", | |
true | |
); | |
key.setEditKey( | |
[["M-n"], ["C-i"]], | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverTextarea, true, true); | |
}, | |
"次のテキストエリアへフォーカス" | |
); | |
key.setEditKey( | |
[["M-t"], ["M-i"]], | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverTextarea, false, true); | |
}, | |
"前のテキストエリアへフォーカス" | |
); | |
key.setEditKey( | |
"M-h", | |
function(ev) { | |
command.backwardWord(ev); | |
}, | |
"一単語左へ移動" | |
); | |
key.setEditKey( | |
"C-j", | |
function(ev) { | |
key.generateKey(ev.originalTarget, KeyEvent.DOM_VK_RETURN, true); | |
}, | |
"リターンコードを生成" | |
); | |
key.setCaretKey( | |
[["C-a"], ["^"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectBeginLine") | |
: goDoCommand("cmd_beginLine"); | |
}, | |
"キャレットを行頭へ移動" | |
); | |
key.setCaretKey( | |
[["C-e"], ["$"], ["M->"], ["G"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectEndLine") | |
: goDoCommand("cmd_endLine"); | |
}, | |
"キャレットを行末へ移動" | |
); | |
key.setCaretKey( | |
[["C-n"], ["j"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectLineNext") | |
: goDoCommand("cmd_scrollLineDown"); | |
}, | |
"キャレットを一行下へ" | |
); | |
key.setCaretKey( | |
[["C-t"], ["k"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectLinePrevious") | |
: goDoCommand("cmd_scrollLineUp"); | |
}, | |
"キャレットを一行上へ" | |
); | |
key.setCaretKey( | |
[["C-s"], ["s"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectCharNext") | |
: goDoCommand("cmd_scrollRight"); | |
}, | |
"キャレットを一文字右へ移動" | |
); | |
key.setCaretKey( | |
[["C-h"], ["h"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectCharPrevious") | |
: goDoCommand("cmd_scrollLeft"); | |
}, | |
"キャレットを一文字左へ移動" | |
); | |
key.setCaretKey( | |
[["M-s"], ["w"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectWordNext") | |
: goDoCommand("cmd_wordNext"); | |
}, | |
"キャレットを一単語右へ移動" | |
); | |
key.setCaretKey( | |
[["M-h"], ["W"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectWordPrevious") | |
: goDoCommand("cmd_wordPrevious"); | |
}, | |
"キャレットを一単語左へ移動" | |
); | |
key.setCaretKey( | |
[["C-v"], ["SPC"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectPageNext") | |
: goDoCommand("cmd_movePageDown"); | |
}, | |
"キャレットを一画面分下へ" | |
); | |
key.setCaretKey( | |
[["M-v"], ["t"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectPagePrevious") | |
: goDoCommand("cmd_movePageUp"); | |
}, | |
"キャレットを一画面分上へ" | |
); | |
key.setCaretKey( | |
[["M-<"], ["g"]], | |
function(ev) { | |
ev.target.ksMarked | |
? goDoCommand("cmd_selectTop") | |
: goDoCommand("cmd_scrollTop"); | |
}, | |
"キャレットをページ先頭へ移動" | |
); | |
key.setCaretKey( | |
"J", | |
function(ev) { | |
util.getSelectionController().scrollLine(true); | |
}, | |
"画面を一行分下へスクロール" | |
); | |
key.setCaretKey( | |
"K", | |
function(ev) { | |
util.getSelectionController().scrollLine(false); | |
}, | |
"画面を一行分上へスクロール" | |
); | |
key.setCaretKey( | |
",", | |
function(ev) { | |
util.getSelectionController().scrollHorizontal(true); | |
goDoCommand("cmd_scrollLeft"); | |
}, | |
"左へスクロール" | |
); | |
key.setCaretKey( | |
".", | |
function(ev) { | |
goDoCommand("cmd_scrollRight"); | |
util.getSelectionController().scrollHorizontal(false); | |
}, | |
"右へスクロール" | |
); | |
key.setCaretKey( | |
"z", | |
function(ev) { | |
command.recenter(ev); | |
}, | |
"キャレットの位置までスクロール" | |
); | |
key.setCaretKey( | |
[["C-SPC"], ["C-@"]], | |
function(ev) { | |
command.setMark(ev); | |
}, | |
"マークをセット", | |
true | |
); | |
key.setCaretKey( | |
":", | |
function(ev, arg) { | |
shell.input(null, arg); | |
}, | |
"コマンドの実行", | |
true | |
); | |
key.setCaretKey( | |
"R", | |
function(ev) { | |
BrowserReload(); | |
}, | |
"更新", | |
true | |
); | |
key.setCaretKey( | |
"H", | |
function(ev) { | |
BrowserBack(); | |
}, | |
"戻る" | |
); | |
key.setCaretKey( | |
"S", | |
function(ev) { | |
BrowserForward(); | |
}, | |
"進む" | |
); | |
key.setCaretKey( | |
["C-x", "h"], | |
function(ev) { | |
goDoCommand("cmd_selectAll"); | |
}, | |
"すべて選択", | |
true | |
); | |
key.setCaretKey( | |
"i", | |
function(ev) { | |
command.focusElement(command.elementsRetrieverTextarea, 0); | |
}, | |
"最初のインプットエリアへフォーカス", | |
true | |
); | |
key.setCaretKey( | |
"M-t", | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverButton, true, true); | |
}, | |
"次のボタンへフォーカスを当てる" | |
); | |
key.setCaretKey( | |
"M-n", | |
function(ev) { | |
command.walkInputElement(command.elementsRetrieverButton, false, true); | |
}, | |
"前のボタンへフォーカスを当てる" | |
); | |
key.setGlobalKey( | |
"C-r", | |
function(ev) { | |
command.iSearchBackwardKs(ev); | |
}, | |
"Emacs ライクな逆方向インクリメンタル検索", | |
true | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment