-
Notifications
You must be signed in to change notification settings - Fork 1
/
.conkerorrc
92 lines (75 loc) · 3.7 KB
/
.conkerorrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// -*- Mode: espresso -*-
// TODO:// * fix indentation in js2-mode
// * get mozrepl working
interactive("fill-domain", "Fill the minibuffer with the current domain.",
function (I) {
var field = I.minibuffer.input_element;
var paths = String(I.window.content.location).split('/');
var domain = paths[0] + "/" + paths[1] + "/" + paths[2] + "/";
field.value = domain;
});
define_key(minibuffer_keymap, "C-/", "fill-domain");
interactive("tinyurl", "Create a TinyURL for the current URL",
function(I) {
I.window.content.location.href = 'http://tinyurl.com/create.php?url=' +
encodeURIComponent(I.window.content.location.href);
});
interactive("instapaper", "Add current page to instapaper",
function(I) {
var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.instapaper.com/b',l=d.location,e=encodeURIComponent,p='?v=4&k=AID0XqXcLEdQ&u='+e(l.href) +'&t='+e(d.title) +'&s='+e(s),u=f+p;try{if(!/^(.*\.)?instapaper([^.]*)?$/.test(l.host))throw(0);iptstbt();}catch(z){a =function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=250,height=150'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}
});
define_webjump("hub", "http://github.com/search?q=%s");
define_webjump("twitter", "http://twitter.com/#search?q=%s");
define_webjump("wikipedia", "http://www.google.com/search?q=wikipedia+%s&btnI=I'm Feeling Lucky");
define_webjump("mvn", "http://jarvana.com/jarvana/search?search_type=project&project=%s");
add_delicious_webjumps ("technomancy");
key_bindings_ignore_capslock = true;
url_remoting_fn = load_url_in_new_buffer;
url_completion_use_history = true;
url_completion_use_bookmarks = false;
can_kill_last_buffer = false;
download_buffer_automatic_open_target = OPEN_NEW_BUFFER_BACKGROUND;
register_user_stylesheet(
"data:text/css,"+
escape("#minibuffer, tree.completions, .mode-line { font-family: Inconsolata; font-size: 12pt; }"));
// register_user_stylesheet(
// "data:text/css," +
// escape ("@-moz-document url-prefix(https://github.com/) .topsearch input { width: 10em; }"));
register_user_stylesheet(
"data:text/css," +
escape (".topsearch input { width: 2em; };"));
interactive("toggle-stylesheets",
"Toggle whether conkeror uses style sheets (CSS) for the " +
"current buffer. It is sometimes useful to turn off style " +
"sheets when the web site makes obnoxious choices.",
function(I) {
var s = I.buffer.document.styleSheets;
for (var i = 0; i < s.length; i++)
s[i].disabled = !s[i].disabled;
});
// Thanks; _why!
function resize_textarea_up(field) {
var h = field.offsetHeight;
if (h > 120)
field.style.height = (h - 60) + "px";
}
function resize_textarea_down(field) {
field.style.height = (parseInt(field.offsetHeight) + 60) + "px";
}
interactive(
"resize-textarea-up",
"Resize a textarea to be smaller.",
function (I) { call_on_focused_field(I, resize_textarea_up); }
);
interactive(
"resize-textarea-down",
"Resize a textarea to be taller.",
function (I) { call_on_focused_field(I, resize_textarea_down); }
);
define_key(content_buffer_textarea_keymap, "C-up", "resize-textarea-up", $category = "Movement");
define_key(content_buffer_textarea_keymap, "C-down", "resize-textarea-down", $category = "Movement");
require("page-modes/google-search-results.js");
auto_mode_list.push([build_url_regex($domain = /google\.com/),
google_search_results_mode]);
user_pref('extensions.mozrepl.autoStart', true);
xkcd_add_title = true;