Skip to content

Instantly share code, notes, and snippets.

@mullikine
Created November 19, 2014 23:34
Show Gist options
  • Save mullikine/8b9cb6a1c843fbfc3109 to your computer and use it in GitHub Desktop.
Save mullikine/8b9cb6a1c843fbfc3109 to your computer and use it in GitHub Desktop.
Pentadactyl patch. Added default search string feature. Press F1 to search buildwith.com on current website. Restored C-v for paste (swapped with C-t)
diff -r cef5557669dc -r 1f3bfd78d908 common/content/bookmarks.js
--- a/common/content/bookmarks.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/bookmarks.js Thu Nov 20 12:20:02 2014 +1300
@@ -650,6 +650,10 @@
}
});
+ options.add(["defsearchtext", "ds"],
+ "The default search query",
+ "string", "", {});
+
options.add(["suggestengines"],
"Search engines used for search suggestions",
"stringlist", "google",
diff -r cef5557669dc -r 1f3bfd78d908 common/content/browser.js
--- a/common/content/browser.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/browser.js Thu Nov 20 12:20:02 2014 +1300
@@ -243,13 +243,25 @@
"Open one or more URLs, based on current location",
function () { open("", decode(buffer.uri.spec)); });
+ mappings.add([modes.NORMAL], ["U"],
+ "Get the BuiltWith info for the current site",
+ function () { open("tab", "builtwith " + decode(buffer.uri.spec)); });
+
+ mappings.add([modes.NORMAL], ["zs"],
+ "Open a search prompt",
+ function () { open("tab", options["defsearch"] + " " + dactyl.profileName + " "); });
+
+ mappings.add([modes.NORMAL], ["zS"],
+ "Open a search prompt for a new tab",
+ function () { open("", options["defsearch"] + " " + config.profileName + " "); });
+
mappings.add([modes.NORMAL], ["s"],
"Open a search prompt",
- function () { open("", options["defsearch"] + " "); });
+ function () { open("", options["defsearch"] + " " + options["defsearchtext"]); });
mappings.add([modes.NORMAL], ["S"],
"Open a search prompt for a new tab",
- function () { open("tab", options["defsearch"] + " "); });
+ function () { open("tab", options["defsearch"] + " " + options["defsearchtext"]); });
mappings.add([modes.NORMAL], ["t"],
"Open one or more URLs in a new tab",
diff -r cef5557669dc -r 1f3bfd78d908 common/content/editor.js
--- a/common/content/editor.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/editor.js Thu Nov 20 12:20:02 2014 +1300
@@ -1113,7 +1113,7 @@
bind(["<C-d>"], "Delete character to the right",
function () { editor.executeCommand("cmd_deleteCharForward", 1); });
- bind(["<S-Insert>"], "Insert clipboard/selection",
+ bind(["<C-v>"], "Insert clipboard/selection",
function () { editor.paste(); });
bind(["<C-i>"], "Edit text field with an external editor",
diff -r cef5557669dc -r 1f3bfd78d908 common/content/events.js
--- a/common/content/events.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/events.js Thu Nov 20 12:20:02 2014 +1300
@@ -731,7 +731,7 @@
let ignore = false;
if (mode.main == modes.PASS_THROUGH)
- ignore = !Events.isEscape(key) && key != "<C-v>";
+ ignore = !Events.isEscape(key) && key != "<S-Insert>";
else if (mode.main == modes.QUOTE) {
if (modes.getStack(1).main == modes.PASS_THROUGH) {
mode = Modes.StackElement(modes.getStack(2).main);
@@ -1053,7 +1053,7 @@
});
mappings.add([modes.MAIN, modes.PASS_THROUGH, modes.QUOTE],
- ["<C-v>", "<pass-next-key>"], "Pass through next key",
+ ["<S-Insert>", "<pass-next-key>"], "Pass through next key",
function () {
if (modes.main == modes.QUOTE)
return Events.PASS;
diff -r cef5557669dc -r 1f3bfd78d908 common/content/statusline.js
--- a/common/content/statusline.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/statusline.js Thu Nov 20 12:20:02 2014 +1300
@@ -11,7 +11,7 @@
var StatusLine = Module("statusline", {
init: function init() {
this._statusLine = document.getElementById("status-bar");
- this.statusBar = document.getElementById("addon-bar") || this._statusLine;
+ this.statusBar = this._statusLine;
this.baseGroup = this.statusBar == this._statusLine ? "StatusLine " : "";
diff -r cef5557669dc -r 1f3bfd78d908 common/content/tabs.js
--- a/common/content/tabs.js Sat Aug 02 21:25:32 2014 -0700
+++ b/common/content/tabs.js Thu Nov 20 12:20:02 2014 +1300
@@ -1198,7 +1198,7 @@
{ count: true });
}
- mappings.add([modes.NORMAL], ["<C-^>", "<C-6>"],
+ mappings.add([modes.NORMAL], ["gl"],
"Select the alternate tab or the [count]th tab",
function ({ count }) {
if (count != null)
diff -r cef5557669dc -r 1f3bfd78d908 common/locale/en-US/map.xml
--- a/common/locale/en-US/map.xml Sat Aug 02 21:25:32 2014 -0700
+++ b/common/locale/en-US/map.xml Thu Nov 20 12:20:02 2014 +1300
@@ -461,8 +461,8 @@
</item>
<item>
- <tags><![CDATA[send-key <pass-next-key> <C-v>]]></tags>
- <spec><![CDATA[<C-v>]]></spec>
+ <tags><![CDATA[send-key <pass-next-key> <S-Insert>]]></tags>
+ <spec><![CDATA[<S-Insert>]]></spec>
<description>
<p>
Pass the next key press directly to &dactyl.host;.
diff -r cef5557669dc -r 1f3bfd78d908 common/locale/en-US/options.xml
--- a/common/locale/en-US/options.xml Sat Aug 02 21:25:32 2014 -0700
+++ b/common/locale/en-US/options.xml Thu Nov 20 12:20:02 2014 +1300
@@ -573,6 +573,18 @@
</item>
<item>
+ <tags>'dst' 'defsearchtext'</tags>
+ <spec>'defsearchtext' 'dst'</spec>
+ <type>&option.defsearchtext.type;</type>
+ <default>&option.defsearchtext.default;</default>
+ <description>
+ <p>
+ Sets the default text to display when searching.
+ </p>
+ </description>
+</item>
+
+<item>
<tags>'dls' 'dlsort' 'downloadsort'</tags>
<spec>'downloadsort' 'dlsort' 'dls'</spec>
<strut/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment