forked from denlab/stumpwm-config
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.conkerorrc
281 lines (202 loc) · 9.45 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
// -*- javascript -*-
/* ------------------------------------------------------------------------- */
/* Conkeror config file */
/* ------------------------------------------------------------------------- */
require("global-overlay-keymap");
define_key_alias("C-m", "return");
define_key_alias("C-j", "return");
define_key_alias("C-i", "tab");
// reload conkerorrc with C-c r
interactive("reload-config", "Reload ~/.conkerorrc configuration file",
function(I) {
load_rc();
I.window.minibuffer.message("config reloaded");
}
);
define_key(default_global_keymap, "C-c r", "reload-config");
// To bind M-[0-9] to switch buffer
function define_switch_buffer_key(key, buf_num) {
define_key(default_global_keymap, key,
function (I) {
switch_to_buffer(I.window,
I.window.buffers.get_buffer(buf_num));
});
}
for (let i = 0; i < 10; ++i) {
define_switch_buffer_key(String("M-" + (i+1)%10), i);
}
/* ------------------- url completion --------------------------------------*/
url_completion_use_history = true;
url_completion_use_bookmarks = true;
/* links opened from other applications open in conkeror */
url_remoting_fn = load_url_in_new_buffer;
// load download buffers in the background in the current
// window, instead of in new windows.
download_buffer_automatic_open_target = OPEN_NEW_BUFFER_BACKGROUND;
/* mode-line widget config ----------------------------------*/
/* ------------------- buffer count indicator ----------------------------------*/
// add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true);
/* ------------------- remove useless clock ----------------------------------*/
// remove_hook("mode_line_hook", mode_line_adder(clock_widget));
/* Displaying Favicons */
require("favicon");
/* ---------------- favicon in mode line */
// add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
/* ---------------- favicon in mini buffer */
read_buffer_show_icons = true;
/* ---------------- Using letters as hints */
hint_digits="qwertyzvbshkl";
// supposed to be set to a number of milliseconds to
// wait after each keystroke before automatically
// closing hints mode with the currently selected
// hint as the final result, when the input has
// narrowed the selection down to one possibility.
hints_auto_exit_delay=0.1; // work if only > 0
// default directory for downloads and shell commands.
cwd = get_home_directory();
cwd.append("downloads");
// automatically handle some mime types internally.
content_handlers.set("application/pdf", content_handler_save);
// external programs for handling various mime types.
external_content_handlers.set("application/pdf", "evince");
external_content_handlers.set("video/*", "urxvtc -e totem");
// use vi as external editor.
editor_shell_command = "emacsclient";
// view source in your editor.
view_source_use_external_editor = true;
// let xkcd-mode put the funny alt text into the page.
xkcd_add_title = true;
/* ---------------- display tabs */
require("new-tabs");
require("github");
require("gmail");
//require("inbox");
require("youtube");
require("youtube-player");
require("twitter");
require("duckduckgo");
require("google-calendar");
require("google-maps");
/* web jumps */
/* -------------- imdb */
/* type 'i your film' in the mini buffer to search 'your film' on imdb*/
define_webjump("i", "http://imdb.com/find?q=%s");
define_webjump("g", "https://duckduckgo.com/?q=%s");
define_webjump("w", "http://en.wikipedia.org?search=%s");
// webjumps
define_webjump("imdb", "http://www.imdb.com/find?q=%s");
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search");
define_webjump("youtube-user", "http://youtube.com/profile_videos?user=%s");
define_webjump("thesaurus","http://www.thefreedictionary.com/%s#Thesaurus");
define_webjump("urban", "http://www.urbandictionary.com/define.php?term=%s");
define_webjump("wayback", function (url) {
if (url) {
return "http://web.archive.org/web/*/" + url;
} else {
return "javascript:window.location.href='http://web.archive.org/web/*/'+window.location.href;";
}
});
define_webjump("down?", function (url) {
if (url) {
return "http://downforeveryoneorjustme.com/" + url;
} else {
return "javascript:window.location.href='http://downforeveryoneorjustme.com/'+window.location.href;";
}
});
/* javascript injection (jquery) */
/*
To use this,
M-x jquery-here
jq> $("h1").css("backgroundColor", "blue");
*/
function install_jquery(d) {
var script_el = d.createElementNS(XHTML_NS, "script");
script_el.setAttribute("language", "javascript");
script_el.setAttribute("type", "text/javascript");
script_el.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
d.body.appendChild(script_el);
}
function jquery_this_doc(d, js_code) {
install_jquery(d);
var script_el = d.createElementNS(XHTML_NS, "script");
script_el.textContent = js_code;
d.body.appendChild(script_el);
}
interactive("jquery-here",
"load jquery.js into this page, then your command",
function(I) {
jquery_this_doc(I.buffer.document, (yield I.minibuffer.read($prompt = "jq> ", $history = "jquery-here")));
// Providing a $history is what allows editing/replay of earlier commands
});
// binding.js is the binding orchestrator
// -------- basic command.js
// -------- global.js
// Base binding for help (C-h by default)
define_key(default_global_keymap, "M-?", default_help_keymap);
// buffer manipulation
define_key(default_global_keymap, "C-w", "kill-current-buffer"); // default: q
define_key(default_global_keymap, "C-x k", "kill-current-buffer"); // default: q
define_key(default_global_keymap, "C-x C-k", "kill-buffer");// default: C-x k
// -------- text.js
// rebind global (for help: M-?)
//define_key(default_global_keymap, "C-h", "go-back");
define_key(text_keymap, "C-h", "cmd_deleteCharBackward"); // default: backspace
define_key(text_keymap, "M-C-h", "cmd_deleteWordBackward");// default: backspace
// default interesting binding to maybe exploit for selection
// define_key(text_keymap, "S-home", "cmd_selectBeginLine");
// define_key(text_keymap, "S-end", "cmd_selectEndLine");
// define_key(text_keymap, "C-S-left", "cmd_selectWordPrevious");
// define_key(text_keymap, "C-S-right", "cmd_selectWordNext");
// -------- content-buffer/normal.js
define_key(content_buffer_normal_keymap, "C-c f", "forward");
define_key(content_buffer_normal_keymap, "C-c b", "back");
define_key(content_buffer_normal_keymap, "C-c r", "reload");
// define_key(content_buffer_normal_keymap, "C-h", "go-back");
// define_key(content_buffer_normal_keymap, "S-C-h", "go-forward");
define_key(content_buffer_normal_keymap, "C-i", "browser-focus-next-form-field");
define_key(content_buffer_normal_keymap, "C-S-i", "browser-focus-previous-form-field");
// rebound from element.js
//define_key(content_buffer_normal_keymap, "k", "bookmark");
// --------- minibuffer.js
define_key(minibuffer_keymap, "C-m", "exit-minibuffer");// default: return (`enter`)
define_key(minibuffer_keymap, "C-i", "minibuffer-complete");
define_key(minibuffer_keymap, "C-S-i", "minibuffer-complete-previous");
// --------- hints.js
define_key(hint_keymap, "C-h", "hints-backspace");
define_key(hint_keymap, "C-i", "hints-next");
define_key(hint_keymap, "C-S-i", "hints-previous");
define_key(hint_keymap, "C-m", "hints-exit");
// find a way to use letters instead of number for hint representation
//define_key(hint_keymap, match_hint_digit, "hints-handle-number");
// --------- isearch.js
define_key(isearch_keymap, "C-h", "isearch-backspace");// default: back_space
// --------- content-buffer/text.js
define_key(content_buffer_text_keymap, "C-i", "");// default: `edit-current-field-in-external-editor` function, use C-x x instead
// --------- content-buffer/element.js
define_key(content_buffer_normal_keymap, "d", "follow");// default: f (follow)
define_key(content_buffer_normal_keymap, "C-d", "delete");// default: d (delete dom element)
// --------- old setup (does not know if this work yet)
// // Use `C-i` as tab
// define_key(google_gqueues_keymap, "C-i", null, $fallthrough);
// define_key(gmail_keymap, "C-i", null, $fallthrough);
// define_key(google_calendar_keymap, "C-i", null, $fallthrough);
// define_key(google_gqueues_keymap, "C-S-i", null, $fallthrough);
// // Use `C-m` as `return`
// define_key(content_buffer_anchor_keymap, "C-m", "follow", $browser_object = browser_object_focused_element);
// define_key(content_buffer_form_keymap, "C-m", null, $fallthrough);
// define_key(content_buffer_select_keymap, "C-m", null, $fallthrough);
// define_key(content_buffer_button_keymap, "C-m", "follow", $browser_object = browser_object_focused_element);
// define_key(gmail_keymap, "C-m", null, $fallthrough);
// define_key(twitter_keymap, "C-m", null, $fallthrough);
// define_key(facebook_keymap, "C-m", null, $fallthrough);
// define_key(google_search_results_keymap, "C-m", "ensure-content-focused", $fallthrough);//BAD
// define_key(google_calendar_keymap, "C-m", null, $fallthrough);
// define_key(duckduckgo_select_keymap, "C-m", "duckduckgo-follow-current");
// --------- mozrepl
user_pref('extensions.mozrepl.autoStart', true); /* autostart */
if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
.getService(Ci.nsIMozRepl);
if (!mozrepl.isActive())
mozrepl.start(4242);
}