summaryrefslogtreecommitdiffstats
path: root/conkeror/.conkerorrc/init.js
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-03 21:38:57 +0100
committerGravatar Tom Willemse2013-11-03 21:38:57 +0100
commitc1623b38c2a8ee582f204c837130a0e945e07e09 (patch)
treed278daa4eecc6ea9440ff1dd1b3c76375431930a /conkeror/.conkerorrc/init.js
parent48833ba0ac58be4a7b6963008ff0e1016d5d8dd8 (diff)
downloaddotfiles-c1623b38c2a8ee582f204c837130a0e945e07e09.tar.gz
dotfiles-c1623b38c2a8ee582f204c837130a0e945e07e09.zip
Update conkeror config
Diffstat (limited to 'conkeror/.conkerorrc/init.js')
-rw-r--r--conkeror/.conkerorrc/init.js83
1 files changed, 27 insertions, 56 deletions
diff --git a/conkeror/.conkerorrc/init.js b/conkeror/.conkerorrc/init.js
index 520ef04..94a84e9 100644
--- a/conkeror/.conkerorrc/init.js
+++ b/conkeror/.conkerorrc/init.js
@@ -4,10 +4,13 @@ require("session");
load_paths.push("file:///usr/local/clark/share/conkeror/modules/");
load_paths.push("file:///home/slash/projects/cdispass/");
+load_paths.push("file:///home/slash/.conkerorrc/site-js/");
+load_paths.push("file:///home/slash/.conkerorrc/clark-conkeror/");
theme_load_paths.push("/home/slash/.conkerorrc/themes/");
require("clark");
require("cdispass");
+require("quickdispatch");
define_browser_object_class(
"history-url", null,
@@ -93,6 +96,9 @@ define_webjump("php",
define_webjump("python",
"http://docs.python.org/search.html?q=%s&check_keywords=yes&area=default",
$alternative="http://www.python.org");
+define_webjump("pypi",
+ "https://pypi.python.org/pypi?%3Aaction=search&term=%s&submit=search",
+ $alternative="https://pypi.python.org");
define_webjump("ddg",
"https://duckduckgo.com/?q=%s",
$alternative="https://duckduckgo.com");
@@ -100,7 +106,7 @@ define_webjump("metal-archives",
"http://www.metal-archives.com/search?searchString=%s&type=band_name",
$alternative="http://www.metal-archives.com");
define_webjump("djangodocs",
- "https://docs.djangoproject.com/search/?q=%s&release=5",
+ "https://docs.djangoproject.com/search/?q=%s",
$alternative="https://docs.djangoproject.com/");
define_webjump("google",
"https://duckduckgo.com?q=!google%%20%s");
@@ -113,6 +119,8 @@ define_webjump("mdn",
define_webjump("monsterhunter",
"http://monsterhunter.wikia.com/wiki/index.php?search=%s&fulltext=Search",
$alternative="http://monsterhunter.wikia.com/");
+define_webjump("quickdocs", "http://quickdocs.org/search?q=%s",
+ $alternative="http://quickdocs.org/");
// Archlinux
define_webjump("arch/wiki",
"https://wiki.archlinux.org/index.php?search=%s",
@@ -157,13 +165,16 @@ title_format_fn = ext_title_format;
url_remoting_fn = load_url_in_new_buffer;
session_auto_save_auto_load = true;
+define_key(content_buffer_form_keymap, "C-g", "unfocus");
define_key(content_buffer_normal_keymap, "C-x C-b", "switch-to-buffer");
+define_key(content_buffer_normal_keymap, "C-x C-f", "clark-find-url-new-buffer");
define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer");
define_key(content_buffer_normal_keymap, "H", "find-url-from-history");
-define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
-define_key(default_base_keymap, "C-x f", "follow-new-buffer");
define_key(content_buffer_normal_keymap, "b", clark_keymap);
+define_key(content_buffer_normal_keymap, "g", "clark-find-url");
+define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
define_key(content_buffer_text_keymap, "C-c d", "dispass-and-submit");
+define_key(default_base_keymap, "C-x f", "follow-new-buffer");
add_hook("before_quit_hook", oni_before_quit_func);
add_hook("content_policy_hook", content_policy_bytype);
@@ -181,39 +192,6 @@ external_content_handlers.set("application/pdf", "zathura");
external_content_handlers.set("application/vnd.ms-excel", "libreoffice");
var gh_url = "http://github.com/";
-function read_url_github_ad_command_handler(input)
-{
- var m = /^gh\s+@(\S+)(?:\s+((?:un)?follow))?/.exec(input);
- if (m) {
- if (m[2])
- return gh_url + "users/follow?target=";
- return gh_url + m[1];
- }
-
- return null;
-}
-
-function read_url_github_my_command_handler(input)
-{
- var m = /^gh\s+my\s+(dashboard|issues|notifications|profile|pulls|stars)/.exec(input);
-
- if (m) {
- switch (m[1]) {
- case "dashboard":
- case "notifications":
- case "stars":
- return gh_url + m[1];
- case "issues":
- case "pulls":
- return gh_url + "dashboard/" + m[1];
- case "profile":
- return gh_url + "settings/" + m[1];
- }
- }
-
- return null;
-}
-
function read_url_github_repo_command_handler(input)
{
var m = /^gh\s+(\S+\/\S+)(?:\s+(\#\d+|\@\S+|issues|pulls|wiki|graphs|network|admin)(?:\s+(\#\d+|new))?)?$/.exec(input);
@@ -261,28 +239,11 @@ function read_url_github_repo_command_handler(input)
function read_url_github_command_handler(input)
{
- return read_url_github_ad_command_handler(input)
- || read_url_github_my_command_handler(input)
- || read_url_github_repo_command_handler(input);
-}
-
-function read_url_local_port_handler(input)
-{
- var m = /^lh (\d{1,5})(?:\s+([a-zA-Z0-9%/]+))?$/.exec(input),
- rv = null;
-
- if (m) {
- rv = "http://localhost:" + m[1];
-
- if (m[2])
- rv += "/" + m[2];
- }
-
- return rv;
+ return read_url_github_repo_command_handler(input);
}
-read_url_handler_list = [read_url_local_port_handler,
- read_url_github_command_handler];
+read_url_handler_list = [read_url_github_command_handler,
+ read_url_qd_handler];
// Mozrepl
let (mozrepl_init = get_home_directory()) {
@@ -313,3 +274,13 @@ register_user_stylesheet(
oni_add_sheet("github.css");
oni_add_sheet("help.css");
oni_add_sheet("git-scm.css");
+
+// Overwrite built-in one
+function scroll_horiz_complete (buffer, n, y) {
+ var w = buffer.focused_frame;
+ w.scrollTo (n > 0 ? w.scrollMaxX : 0, y == null ? w.scrollY : y);
+}
+
+interactive("scroll-top-left",
+ "Scroll the current frame all the way to the top left",
+ function (I) { scroll_horiz_complete(I.buffer, -1, 0); });