SaltyCrane Blog — Notes on JavaScript and web development

Conkeror: "Firefox for Emacs users"

I recently discovered Conkeror via Bill Clementson's article, Firefox for Emacs users. I must say it is pretty sweet. It's the type of thing that makes you have to get up and go to the bathroom because it's so exciting.

So I switched over to Emacs from Eclipse about 4 months ago. Though it has been slow learning everything in Emacs, I am starting to feel pretty comfortable now and actually feel uneasy when I'm using another editor. It is very nice to be able to do everything with the keyboard in Emacs. I can do all cursor movement, scrolling, and selection very nicely in Emacs. And all text manipulation commands are immediately accessible from the keyboard. Pair that with a bash command line running inside GNU screen, and I can do about 50% of my work without using a mouse. Of the other 50%, one big chunk is Microsoft Outlook which, as far as I know, I need because we are using an Exchange server. But the other big chunk is web browsing, which, up until now, has been very mouse dependent.

Enter Conkeror, the keyboard-driven web browser that "conkers" the web without a mouse. (I just made that up, btw. I do not know the origin of the name "Conkeror".) Conkeror is a Mozilla-based browser (e.g. Firefox) with an Emacs-like skin. Emacs users should feel at right home-- screen-stealing toolbars and menubars are gone. In their place is the modeline and mini-buffer. Commands are entered using M-x, switch buffers using C-x b, incremental search using C-s, and edit text using Emacs editing conventions. (Being a relative Emacs newbie, I actually rebound a lot of these to be more Windows/Firefox friendly. But I expect long time Emacs users would rejoice.)

In my opinion, the best part about Conkeror is the hyperlink navigation design. Hitting the f key while browsing highlights all possible hyperlinks (or focus areas) within the current view. Limiting the scope of choices to the current view is smart because you most likely won't want to follow a link that's not in the current view. To follow a link, there are two options. The first is to type in the link number which is overlaid in the top left corner of each link. The second method is to start typing any part of the link text and tab through the remaining selections. A different color highlight shows which link is currently selected. The second method is very fast-- however, the first method is more robust in that it can handle links with no text or a large number of links with similar text.

Conkeror is currently being actively developed and can be considered to be alpha stage software so there are issues and bugs. Also the documentation seems to be pretty sparse. However, to me, it looks like a really great tool with a potential for much more efficient and comfortable browsing. Kudos to the authors.

Will I ditch Firefox for Conkeror? That question remains to be answered. I hope the answer will be yes. I plan to use it for a few days and see if I run across any deal-breakers. Hopefully, with Conkeror, I can up my mouseless activity to around 70%.

Below are some notes on using Conkeror. I am using the snapshot XULRunner version of Conkeror on Windows XP.



How to set a proxy server

Assuming you have your proxy configured in Firefox already...

  • Type g about:config and hit ENTER in Conkeror.
  • Hit ENTER to promise you'll be careful.
  • Hit TAB to get to the "Filter:" box and type in "proxy".
  • Go to about:config in Firefox and filter on "proxy".
  • Make the relevant settings in Conkeror match Firefox. Make sure you set "network.proxy.type" in addition to the proxy servers. (If you were wondering, no, I don't know how to set these preferences without using the mouse.)


Here is my .conkerorrc file:

See also dotfiles.org for a few more.

// new bindings
define_key(default_global_keymap, "C-w", "kill-current-buffer");

// rebound from global.js
define_key(default_global_keymap, "h", "find-url");
define_key(default_global_keymap, "f1", default_help_keymap);
define_key(default_global_keymap, "b", "switch-to-buffer");
define_key(default_global_keymap, "C-f", "isearch-forward"); 
// note, i had to comment out the "C-f" binding in basic-commands.js to make this work

// rebound from isearch.js
define_key(isearch_keymap, "C-f", "isearch-continue-forward");

// rebound from normal.js
define_key(content_buffer_normal_keymap, "back_space", "go-back");
define_key(content_buffer_normal_keymap, "S-back_space", "go-forward");

// rebound from element.js
//define_key(content_buffer_normal_keymap, "k", "bookmark");

// rebound from basic-commands.js
define_key(content_buffer_normal_keymap, "home","beginning-of-line");
define_key(content_buffer_normal_keymap, "end","end-of-line");
define_key(content_buffer_normal_keymap, "C-home","cmd_scrollTop");    
define_key(content_buffer_normal_keymap, "C-end","cmd_scrollBottom");

// rebound from text.js
define_key(content_buffer_text_keymap, "home", "cmd_beginLine");
define_key(content_buffer_text_keymap, "end", "cmd_endLine");
define_key(content_buffer_text_keymap, "C-left", "cmd_wordPrevious");
define_key(content_buffer_text_keymap, "C-right", "cmd_wordNext");
define_key(content_buffer_text_keymap, "C-y", "cmd_redo");
define_key(content_buffer_text_keymap, "C-z", "cmd_undo");
define_key(content_buffer_text_keymap, "C-v", "cmd_paste");
define_key(content_buffer_text_keymap, "C-x", "cmd_cut");
define_key(content_buffer_text_keymap, "C-c", "cmd_copy");

// new for textarea.js
define_key(content_buffer_textarea_keymap, "home", "cmd_beginLine");
define_key(content_buffer_textarea_keymap, "end", "cmd_endLine");
define_key(content_buffer_textarea_keymap, "C-left", "cmd_wordPrevious");
define_key(content_buffer_textarea_keymap, "C-right", "cmd_wordNext");
define_key(content_buffer_textarea_keymap, "C-y", "cmd_redo");
define_key(content_buffer_textarea_keymap, "C-z", "cmd_undo");
define_key(content_buffer_textarea_keymap, "C-v", "cmd_paste");
define_key(content_buffer_textarea_keymap, "C-x", "cmd_cut");
define_key(content_buffer_textarea_keymap, "C-c", "cmd_copy");

// rebound for textarea.js
define_key(content_buffer_textarea_keymap, "C-home", "cmd_moveTop");
define_key(content_buffer_textarea_keymap, "C-end", "cmd_moveBottom");

// rebound from zoom.js
define_key(content_buffer_normal_keymap, "C-subtract", "zoom-out-text");
define_key(content_buffer_normal_keymap, "C-add", "zoom-in-text");

// webjumps 
add_delicious_webjumps ("saltycrane");
add_webjump("g", "www.google.com/search?q=%s");
add_webjump("d", "del.icio.us/saltycrane/%s");
add_webjump("blank", "about:blank");
add_webjump("reader", "www.google.com/reader");


How to search the Conkeror mailing list archive

Don't use the one linked from the Conkeror website. Instead use: http://www.nabble.com/MozDev---conkeror-f11304.html



How to get out of Adobe reader when visiting a pdf file

See this thread on the MozDev - conkeror mailing list archive.



How to copy a link

Use the c command.



add_command doesn't work!

Per the ChangeLog, it was renamed to interactive. I still can't figure out how to use message though.



How to uninstall XULRunner

Run the command xulrunner --unregister-user and then delete the xulrunner directory. If you deleted the xulrunner directory without unregistering, delete the registry items in HKEY_CURRENT_USER\Software\mozilla.org\GRE on Windows, or the directory ~/.gre.d on Linux.

Update 2008-09-11: I discovered Conkeror now has external editing capabilities. I can hit C-i in a text box and it will bring up Emacs. Problems: I set EDITOR and VISUAL to be emacsclient, however, when I spawn conkeror from wmii using MOD-p, and hit C-i in conkeror, it starts a new emacs server instead of connecting to my current one. However, if I just start conkeror from my terminal command line, it works correctly. Also, I don't know how to change the major mode of Emacs for editing the text boxes. Otherwise, good stuff.

Comments


#1 TheGZeus commented on :

Truly no offense is intnded, but I always find it funny when people use awesome tools like Emacs and Conkeror under Windows.
Some people really get alot of good done under Windows, and I admire that.
I don't even do tons of advanced stuff, but I feel constricted under the Windows OS. It's more about the level of customisation and choices. There's also the fact that I prefer to use Free software, but I'm not opposed to proprietary software.
"Sounds like a personal problem." -Someone.


#2 vedang commented on :

@TheGZeus Sometimes there isn't an option but to use Windows. For example, at my workplace, I work on a Windows machine. I have no option about this. Thus, the way for me to make my environment most comfortable is to use tools I'm already familiar with: emacs, cygwin etc.

Further, Windows isn't really all that bad, if you are willing to sit down and tinker with it; which is the same argument for Linux. And I'm a total linux geek. Don't s-h-i-t (apparently, one must watch his mouth :) ) on windows just because it's the fashionable thing to do.


#3 david commented on :

Nice introducion. I agree, it's strange to use Emacs and conkeror inside windows. If you were to use a GNU/linux system and X, you could also use ratpoison and have a window manager that's totally keyboard driven too. It doesn't have the same keyboard bindings as emacs and conkeror to make sure you can manage your windows and use the emacs/conkeror keymappings at the same time. I also agree that it's better for our freedom to use free software. cheers


#4 Eliot commented on :

david: i switched to Ubuntu and the wmii window manager a few months after writing this when I switched jobs and have been happy with that setup for the past couple years. thanks for your comment!


#5 Boris commented on :

I find PentaDactyl better than Conqueror. It's a FireFox extension.


#6 Eliot commented on :

Boris, thanks for the tip. I see that PentaDactyl is written by the authors of Vimperator. That is pretty cool. And one of those authors is an author of wmii! I wonder if it has and option for Emacs keybindings.