Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@webframp
Created April 5, 2012 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webframp/2307768 to your computer and use it in GitHub Desktop.
Save webframp/2307768 to your computer and use it in GitHub Desktop.
conkerrc
// -*- mode: Javascript -*-
// SETTINGS
// use history
url_completion_use_history = true;
// set emacs as external editor
editor_shell_command = 'emacs'
// run_external_editor_function = function (file) {
// keywords(arguments);
// var args = [null, "-t", file.path];
// if (arguments.$line) {
// args.push(["+", arguments.$line]);
// }
// try {
// yield spawn_and_wait_for_process("emacsclient", args);
// } finally {
// if (arguments.$temporary) {
// try {
// file.remove(false);
// } catch (e) {}
// }
// }
// };
// view source in external editor
view_source_use_external_editor = true;
// download location
cwd = get_home_directory();
cwd.append('Downloads');
// xkcd add mouse-over text
xkcd_add_title = true;
// Make sure I don't close by accident
add_hook("before_quit_hook",
function () {
var w = get_recent_conkeror_window();
var result = (w == null) ||
"y" == (yield w.minibuffer.read_single_character_option(
$prompt = "Quit Conkeror? (y/n)",
$options = ["y", "n"]));
yield co_return(result);
});
// be safe about closing
can_kill_last_buffer = false;
// always open urls in new buffer
url_remoting_fn = load_url_in_new_buffer;
// BINDINGS
// redefine C-f as "forwards" and C-b as "backwards"
define_key(content_buffer_normal_keymap, "C-f", "forward");
define_key(content_buffer_normal_keymap, "C-b", "back");
// make M-f and M-b switch to next and previous buffers
define_key(content_buffer_normal_keymap, "M-f", "buffer-next");
define_key(content_buffer_normal_keymap, "M-b", "buffer-previous");
// NEAT
// use M-y to google current selection in new buffer
// use M-Y to google current selection in new buffer "double-quoted"
// [ref: http://www.mozdev.org/pipermail/conkeror/2009-February/001334.html ]
// (See also "**c" for selecting text)
interactive("search-clipboard-contents", "Search in Google the content of the X clipboard (the selected text)",
"find-url",
$browser_object=
function(I) {
return "g "+ read_from_x_primary_selection();
}
);
interactive("search-clipboard-contents-doublequoted", "Search in Google the content of the X clipboard (the selected text) as a fixed string",
"find-url",
$browser_object=
function(I) {
return "g \""+ read_from_x_primary_selection()+"\"";
}
);
define_key(content_buffer_normal_keymap, "M-y", "search-clipboard-contents");
define_key(content_buffer_normal_keymap, "M-Y", "search-clipboard-contents-doublequoted");
// WEBJUMPS
define_webjump("pinboard", function (url) {
if (url) {
return "http://pinboard.in/add?next=same&url=" + url;
} else {
return "javascript:document.location.href='http://pinboard.in/add?next=same&url='+encodeURIComponent(document.location.href)+'&description='+encodeURIComponent(document.getSelection())+'&title='+encodeURIComponent(document.title);";
}
}, $argument = "optional");
define_webjump("ddg", "http://duckduckgo.com/?q=%s", $alternative = "http://duckduckgo.com"); // duckduckgo
define_webjump("archwiki", "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search=%s&fulltext=Search"); //search arch linux wiki
// Session support
require("session.js")
session_auto_save_auto_load = true;
// don't open download window all the time
remove_hook("download_added_hook", open_download_buffer_automatically);
// Page modes
// custom nav on specific sites
require("gmail")
require("duckduckgo")
//require("github")
require("reddit")
//add favicons
require("favicon");
add_hook("mode_line_hook", mode_line_adder(buffer_iconf_widget), true);
read_buffer_show_icons = true;
//add content handlers
content_handlers.set("application/pdf", content_handler_save); //pdf
// other file types?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment