- var myModes = config.browserModes;
-
- mappings.add(myModes,
- ["<C-o>"], "Go to an older position in the jump list",
- function (args) { history.stepTo(-Math.max(args.count, 1)); },
- { count: true });
-
- mappings.add(myModes,
- ["<C-i>"], "Go to a newer position in the jump list",
- function (args) { history.stepTo(Math.max(args.count, 1)); },
- { count: true });
-
- mappings.add(myModes,
- ["H", "<A-Left>", "<M-Left>"], "Go back in the browser history",
- function (args) { history.stepTo(-Math.max(args.count, 1)); },
- { count: true });
-
- mappings.add(myModes,
- ["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history",
- function (args) { history.stepTo(Math.max(args.count, 1)); },
- { count: true });
+ function bind() mappings.add.apply(mappings, [config.browserModes].concat(Array.slice(arguments)));
+
+ bind(["<C-o>"], "Go to an older position in the jump list",
+ function ({ count }) { history.stepTo(-Math.max(count, 1), true); },
+ { count: true });
+
+ bind(["<C-i>"], "Go to a newer position in the jump list",
+ function ({ count }) { history.stepTo(Math.max(count, 1), true); },
+ { count: true });
+
+ bind(["H", "<A-Left>", "<M-Left>"], "Go back in the browser history",
+ function ({ count }) { history.stepTo(-Math.max(count, 1)); },
+ { count: true });
+
+ bind(["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history",
+ function ({ count }) { history.stepTo(Math.max(count, 1)); },
+ { count: true });
+
+ bind(["[d"], "Go back to the previous domain in the browser history",
+ function ({ count }) { history.search("domain", -Math.max(count, 1)) },
+ { count: true });
+
+ bind(["]d"], "Go forward to the next domain in the browser history",
+ function ({ count }) { history.search("domain", Math.max(count, 1)) },
+ { count: true });