public
Description: Phil Hagelberg's personal dotfiles collection: the product of years of accumulated obsessive minor tweaks. Mostly Emacs Lisp.
Homepage: http://technomancy.us
Clone URL: git://github.com/technomancy/dotfiles.git
dotfiles / .conkerorrc
100644 81 lines (68 sloc) 2.837 kb
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
// -*- Mode: js2 -*-
 
// 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);
});
 
define_webjump("hub", "http://github.com/search?q=%s");
define_webjump("twitter", "http://search.twitter.com/search?q=%s");
define_webjump("wikipedia", "http://www.google.com/search?q=wikipedia+%s&btnI=I'm Feeling Lucky");
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; }"));
 
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");
 
// MozRepl
if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
  var mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
    .getService(Ci.nsIMozRepl);
  if (! mozrepl.isActive())
    mozrepl.start(4242);
}