mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 05:27:58 +01:00
Shuffle some key bindings and mode inheritance around.
This commit is contained in:
@@ -1551,11 +1551,11 @@ var Buffer = Module("buffer", {
|
|||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["i", "<Insert>"],
|
mappings.add([modes.NORMAL], ["i", "<Insert>"],
|
||||||
"Start caret mode",
|
"Start caret mode",
|
||||||
function () { modes.push(modes.CARET); });
|
function () { modes.push(modes.CARET); });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["<C-c>"],
|
mappings.add([modes.NORMAL], ["<C-c>"],
|
||||||
"Stop loading the current web page",
|
"Stop loading the current web page",
|
||||||
function () { ex.stop(); });
|
function () { ex.stop(); });
|
||||||
|
|
||||||
@@ -1635,39 +1635,39 @@ var Buffer = Module("buffer", {
|
|||||||
function (args) { buffer.scrollVertical("pages", Math.max(args.count, 1)); },
|
function (args) { buffer.scrollVertical("pages", Math.max(args.count, 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["]f", "<previous-frame>"],
|
mappings.add([modes.NORMAL], ["]f", "<previous-frame>"],
|
||||||
"Focus next frame",
|
"Focus next frame",
|
||||||
function (args) { buffer.shiftFrameFocus(Math.max(args.count, 1)); },
|
function (args) { buffer.shiftFrameFocus(Math.max(args.count, 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["[f", "<next-frame>"],
|
mappings.add([modes.NORMAL], ["[f", "<next-frame>"],
|
||||||
"Focus previous frame",
|
"Focus previous frame",
|
||||||
function (args) { buffer.shiftFrameFocus(-Math.max(args.count, 1)); },
|
function (args) { buffer.shiftFrameFocus(-Math.max(args.count, 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["]]", "<next-page>"],
|
mappings.add([modes.NORMAL], ["]]", "<next-page>"],
|
||||||
"Follow the link labeled 'next' or '>' if it exists",
|
"Follow the link labeled 'next' or '>' if it exists",
|
||||||
function (args) {
|
function (args) {
|
||||||
buffer.findLink("next", options["nextpattern"], (args.count || 1) - 1, true);
|
buffer.findLink("next", options["nextpattern"], (args.count || 1) - 1, true);
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["[[", "<previous-page>"],
|
mappings.add([modes.NORMAL], ["[[", "<previous-page>"],
|
||||||
"Follow the link labeled 'prev', 'previous' or '<' if it exists",
|
"Follow the link labeled 'prev', 'previous' or '<' if it exists",
|
||||||
function (args) {
|
function (args) {
|
||||||
buffer.findLink("previous", options["previouspattern"], (args.count || 1) - 1, true);
|
buffer.findLink("previous", options["previouspattern"], (args.count || 1) - 1, true);
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["gf", "<view-source>"],
|
mappings.add([modes.NORMAL], ["gf", "<view-source>"],
|
||||||
"Toggle between rendered and source view",
|
"Toggle between rendered and source view",
|
||||||
function () { buffer.viewSource(null, false); });
|
function () { buffer.viewSource(null, false); });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["gF", "<view-source-externally>"],
|
mappings.add([modes.NORMAL], ["gF", "<view-source-externally>"],
|
||||||
"View source with an external editor",
|
"View source with an external editor",
|
||||||
function () { buffer.viewSource(null, true); });
|
function () { buffer.viewSource(null, true); });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["gi", "<focus-input>"],
|
mappings.add([modes.NORMAL], ["gi", "<focus-input>"],
|
||||||
"Focus last used input field",
|
"Focus last used input field",
|
||||||
function (args) {
|
function (args) {
|
||||||
let elem = buffer.lastInputField;
|
let elem = buffer.lastInputField;
|
||||||
@@ -1700,7 +1700,7 @@ var Buffer = Module("buffer", {
|
|||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["gP"],
|
mappings.add([modes.NORMAL], ["gP"],
|
||||||
"Open (]put) a URL based on the current clipboard contents in a new buffer",
|
"Open (]put) a URL based on the current clipboard contents in a new buffer",
|
||||||
function () {
|
function () {
|
||||||
let url = dactyl.clipboardRead();
|
let url = dactyl.clipboardRead();
|
||||||
@@ -1708,7 +1708,7 @@ var Buffer = Module("buffer", {
|
|||||||
dactyl.open(url, { from: "paste", where: dactyl.NEW_TAB, background: true });
|
dactyl.open(url, { from: "paste", where: dactyl.NEW_TAB, background: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["p", "<MiddleMouse>", "<open-clipboard-url>"],
|
mappings.add([modes.NORMAL], ["p", "<MiddleMouse>", "<open-clipboard-url>"],
|
||||||
"Open (put) a URL based on the current clipboard contents in the current buffer",
|
"Open (put) a URL based on the current clipboard contents in the current buffer",
|
||||||
function () {
|
function () {
|
||||||
let url = dactyl.clipboardRead();
|
let url = dactyl.clipboardRead();
|
||||||
@@ -1716,7 +1716,7 @@ var Buffer = Module("buffer", {
|
|||||||
dactyl.open(url);
|
dactyl.open(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["P", "<tab-open-clipboard-url>"],
|
mappings.add([modes.NORMAL], ["P", "<tab-open-clipboard-url>"],
|
||||||
"Open (put) a URL based on the current clipboard contents in a new buffer",
|
"Open (put) a URL based on the current clipboard contents in a new buffer",
|
||||||
function () {
|
function () {
|
||||||
let url = dactyl.clipboardRead();
|
let url = dactyl.clipboardRead();
|
||||||
@@ -1725,11 +1725,11 @@ var Buffer = Module("buffer", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// reloading
|
// reloading
|
||||||
mappings.add([modes.COMMAND], ["r", "<reload>"],
|
mappings.add([modes.NORMAL], ["r", "<reload>"],
|
||||||
"Reload the current web page",
|
"Reload the current web page",
|
||||||
function () { tabs.reload(tabs.getTab(), false); });
|
function () { tabs.reload(tabs.getTab(), false); });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["R", "<full-reload>"],
|
mappings.add([modes.NORMAL], ["R", "<full-reload>"],
|
||||||
"Reload while skipping the cache",
|
"Reload while skipping the cache",
|
||||||
function () { tabs.reload(tabs.getTab(), true); });
|
function () { tabs.reload(tabs.getTab(), true); });
|
||||||
|
|
||||||
@@ -1743,62 +1743,62 @@ var Buffer = Module("buffer", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// zooming
|
// zooming
|
||||||
mappings.add([modes.COMMAND], ["zi", "+", "<text-zoom-in>"],
|
mappings.add([modes.NORMAL], ["zi", "+", "<text-zoom-in>"],
|
||||||
"Enlarge text zoom of current web page",
|
"Enlarge text zoom of current web page",
|
||||||
function (args) { buffer.zoomIn(Math.max(args.count, 1), false); },
|
function (args) { buffer.zoomIn(Math.max(args.count, 1), false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["zm", "<text-zoom-more>"],
|
mappings.add([modes.NORMAL], ["zm", "<text-zoom-more>"],
|
||||||
"Enlarge text zoom of current web page by a larger amount",
|
"Enlarge text zoom of current web page by a larger amount",
|
||||||
function (args) { buffer.zoomIn(Math.max(args.count, 1) * 3, false); },
|
function (args) { buffer.zoomIn(Math.max(args.count, 1) * 3, false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["zo", "-", "<text-zoom-out>"],
|
mappings.add([modes.NORMAL], ["zo", "-", "<text-zoom-out>"],
|
||||||
"Reduce text zoom of current web page",
|
"Reduce text zoom of current web page",
|
||||||
function (args) { buffer.zoomOut(Math.max(args.count, 1), false); },
|
function (args) { buffer.zoomOut(Math.max(args.count, 1), false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["zr", "<text-zoom-reduce>"],
|
mappings.add([modes.NORMAL], ["zr", "<text-zoom-reduce>"],
|
||||||
"Reduce text zoom of current web page by a larger amount",
|
"Reduce text zoom of current web page by a larger amount",
|
||||||
function (args) { buffer.zoomOut(Math.max(args.count, 1) * 3, false); },
|
function (args) { buffer.zoomOut(Math.max(args.count, 1) * 3, false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["zz", "<text-zoom>"],
|
mappings.add([modes.NORMAL], ["zz", "<text-zoom>"],
|
||||||
"Set text zoom value of current web page",
|
"Set text zoom value of current web page",
|
||||||
function (args) { buffer.setZoom(args.count > 1 ? args.count : 100, false); },
|
function (args) { buffer.setZoom(args.count > 1 ? args.count : 100, false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["ZI", "zI", "<full-zoom-in>"],
|
mappings.add([modes.NORMAL], ["ZI", "zI", "<full-zoom-in>"],
|
||||||
"Enlarge full zoom of current web page",
|
"Enlarge full zoom of current web page",
|
||||||
function (args) { buffer.zoomIn(Math.max(args.count, 1), true); },
|
function (args) { buffer.zoomIn(Math.max(args.count, 1), true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["ZM", "zM", "<full-zoom-more>"],
|
mappings.add([modes.NORMAL], ["ZM", "zM", "<full-zoom-more>"],
|
||||||
"Enlarge full zoom of current web page by a larger amount",
|
"Enlarge full zoom of current web page by a larger amount",
|
||||||
function (args) { buffer.zoomIn(Math.max(args.count, 1) * 3, true); },
|
function (args) { buffer.zoomIn(Math.max(args.count, 1) * 3, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["ZO", "zO", "<full-zoom-out>"],
|
mappings.add([modes.NORMAL], ["ZO", "zO", "<full-zoom-out>"],
|
||||||
"Reduce full zoom of current web page",
|
"Reduce full zoom of current web page",
|
||||||
function (args) { buffer.zoomOut(Math.max(args.count, 1), true); },
|
function (args) { buffer.zoomOut(Math.max(args.count, 1), true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["ZR", "zR", "<full-zoom-reduce>"],
|
mappings.add([modes.NORMAL], ["ZR", "zR", "<full-zoom-reduce>"],
|
||||||
"Reduce full zoom of current web page by a larger amount",
|
"Reduce full zoom of current web page by a larger amount",
|
||||||
function (args) { buffer.zoomOut(Math.max(args.count, 1) * 3, true); },
|
function (args) { buffer.zoomOut(Math.max(args.count, 1) * 3, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["zZ", "<full-zoom>"],
|
mappings.add([modes.NORMAL], ["zZ", "<full-zoom>"],
|
||||||
"Set full zoom value of current web page",
|
"Set full zoom value of current web page",
|
||||||
function (args) { buffer.setZoom(args.count > 1 ? args.count : 100, true); },
|
function (args) { buffer.setZoom(args.count > 1 ? args.count : 100, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// page info
|
// page info
|
||||||
mappings.add([modes.COMMAND], ["<C-g>", "<page-info>"],
|
mappings.add([modes.NORMAL], ["<C-g>", "<page-info>"],
|
||||||
"Print the current file name",
|
"Print the current file name",
|
||||||
function () { buffer.showPageInfo(false); });
|
function () { buffer.showPageInfo(false); });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND], ["g<C-g>", "<more-page-info>"],
|
mappings.add([modes.NORMAL], ["g<C-g>", "<more-page-info>"],
|
||||||
"Print file information",
|
"Print file information",
|
||||||
function () { buffer.showPageInfo(true); });
|
function () { buffer.showPageInfo(true); });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1591,7 +1591,7 @@ var Events = Module("events", {
|
|||||||
},
|
},
|
||||||
{ arg: true, count: true });
|
{ arg: true, count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND],
|
mappings.add([modes.MAIN],
|
||||||
["<A-m>s", "<sleep>"], "Sleep for {count} milliseconds before continuing macro playback",
|
["<A-m>s", "<sleep>"], "Sleep for {count} milliseconds before continuing macro playback",
|
||||||
function ({ command, count }) {
|
function ({ command, count }) {
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
@@ -1601,7 +1601,7 @@ var Events = Module("events", {
|
|||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.COMMAND],
|
mappings.add([modes.MAIN],
|
||||||
["<A-m>l", "<wait-for-page-load>"], "Wait for the current page to finish loading before continuing macro playback",
|
["<A-m>l", "<wait-for-page-load>"], "Wait for the current page to finish loading before continuing macro playback",
|
||||||
function ({ count }) {
|
function ({ count }) {
|
||||||
if (events.feedingKeys && !events.waitForPageLoad(count)) {
|
if (events.feedingKeys && !events.waitForPageLoad(count)) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ var Modes = Module("modes", {
|
|||||||
});
|
});
|
||||||
this.addMode("CARET", {
|
this.addMode("CARET", {
|
||||||
description: "Active when the caret is visible in the web content",
|
description: "Active when the caret is visible in the web content",
|
||||||
bases: [this.COMMAND]
|
bases: [this.NORMAL]
|
||||||
}, {
|
}, {
|
||||||
|
|
||||||
get pref() prefs.get("accessibility.browsewithcaret"),
|
get pref() prefs.get("accessibility.browsewithcaret"),
|
||||||
@@ -113,7 +113,7 @@ var Modes = Module("modes", {
|
|||||||
});
|
});
|
||||||
this.addMode("OUTPUT_MULTILINE", {
|
this.addMode("OUTPUT_MULTILINE", {
|
||||||
description: "Active when the multi-line output buffer is open",
|
description: "Active when the multi-line output buffer is open",
|
||||||
bases: [this.COMMAND],
|
bases: [this.NORMAL],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addMode("INPUT", {
|
this.addMode("INPUT", {
|
||||||
|
|||||||
Reference in New Issue
Block a user