- // opening websites
- mappings.add([modes.NORMAL],
- ["o"], "Open one or more URLs",
- function () { CommandExMode().open("open "); });
+ let openModes = array.toObject([
+ [dactyl.CURRENT_TAB, ""],
+ [dactyl.NEW_TAB, "tab"],
+ [dactyl.NEW_BACKGROUND_TAB, "background tab"],
+ [dactyl.NEW_WINDOW, "win"]
+ ]);
+
+ function open(mode, args) {
+ if (dactyl.forceTarget in openModes)
+ mode = openModes[dactyl.forceTarget];
+
+ CommandExMode().open(mode + "open " + (args || ""))
+ }