I have imported the old post for now, and will update the rest of the site when I get time. Thank you for your understanding…

– Mads

 

In addition to Vim, I use Emacs for things like org-mode and certain functional programming languages. Of course, I have configured it to behave closely like my Vim setup. The keybinding layout works fine using both Qwerty and Colemak (if you swap Y and J).

Configuration highlights:

  • Viper
  • Tabbar
  • Org-mode

The files are available at my Github repo.

Check out my dotfiles repository at:

github.com/mntnoe/mntnoe-dotfiles

I think it’s about time I post my updated XMonad configuration. This version does not require any patches, at XMonad 0.9 supports modular configurations natively.

New highlights:

  • The application pager now uses icons
  • Per application configuration.
  • Minimize windows by using special workspaces

Note that I have converted my Colemak key bindings to Qwerty to give an idea of the placement I use. Also note that this work is not finished. There are still lot of things I want to behave differently, and I need to do some cleanup here and there.

Still, I hope you can get inspired by some of my ideas. Enjoy :-)

Using Keyconfig

If you use many web applications like GMail and Remember the Milk, you may want to get access to them using a single key binding. In Firefox you can use the following snippet together with the Keyconfig extension to

  • cycle between all tabs matching the regular expression re
  • if no tab matches, open a new tab showing url
function openOrCycle(url, re) {
    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
        .getService(Components.interfaces.nsIWindowMediator);
    var browserEnumerator = wm.getEnumerator("navigator:browser");

    // Check each browser instance for our URL
    var found = false;
    while (!found && browserEnumerator.hasMoreElements()) {
        var browserWin = browserEnumerator.getNext();
        var tabbrowser = browserWin.gBrowser;

 Continue reading “Fast access to web applications” »

Many sites (for instance aula.au.dk) sends binary files using the application/octet-stream mime type. This is annoying for Firefox users, as they presented with a dialog asking Would you like to save this file? instead of showing the standard dialog offering both the options Open with and Save file.

Bug 327323 has a patch that uses gvfs to determine the mime type from the extension if Firefox cannot determine it itself. However, if you can’t wait for that fix to reach your distributions package repository, here is a patch for Firefox 3.5 that bypasses the security restriction for octet-streams and executables. Note that it won’t remember the application you specify to handle the file, but your can circumvent that by using the OpenDownload add-on, which uses your native mime system to look up the default application.

Edit: I found out that OpenDownload also alters the security restricted download dialog, so you can suffice to install OpenDownload if you want to avoid patching Firefox. You will only be able to open the file with your OS’ default handler, though.

GMail has a nice keyboard accelerated web interface making it competitive to desktop mail clients as Thunderbird and even Mutt. One reason I stayed with Mutt for a long time was the ability to integrate with Vim. I switched to GMail’s web interface for other reasons, but nevertheless it was delightful to discover ItsAllText; a Firefox add-on that allows you to edit any textarea in an external editor. Continue reading “Being productive in GMail using ItsAllText” »

As you can see I have polished my blog a little, and added a very important feature: A blog focusing this much on key bindings must naturally have keybindings. Using this plugin, you can now zap back and forth between posts by pressing Shift-Left and Shift-Right – useful huh? :-)

By the way, see Vito Chin’s article about Keyboard Enabling Web Applications.

Wouldn’t it be nice if you could navigate through your application’s menus using vi-like bindings? You can! Simply something like this in your ~/.gtkrc-2.0 file:

binding "gtk-binding-menu" {
    bind "j" { "move-current" (next) }
    bind "k" { "move-current" (prev) }
    bind "h" { "move-current" (parent) }
    bind "l" { "move-current" (child) }
}
class "GtkMenuShell" binding "gtk-binding-menu"

Keybindings for other GTK widgets can be defined in a similar way. What about moving focus between widgets in the direction they appear? Continue reading “Key bindings in GTK applications” »

When using Windows XP at work, I have customized the keyboard layout to almost match my setup on Gentoo — important when you code lines and lines of Java…

In addition to my modified Colemak keyboard layout created by the Microsoft Keyboard Layout Creater, I use scancodes to remap special keys, which is not possible in MKLC.

My current setup is this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlKeyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,08,00,00,00,01,00,3a,00,3a,00,01,00,19,00,46,00,0e,00,19,00,2a,00,56,00,38,00,38,e0,38,e0,2a,00,00,00,00,00

Note: Be careful when pasting stuff like this into your registry — you have been warned :-)

The scancode mapping does the following:

  • Swaps Escape and Caps Lock.
  • Makes QWERTY P an extra Backspace key.
    Remember, Colemak has the semicolon on QWERTY P’s position. This makes it possible to delete
  • Makes P available on Scroll Lock.
    A pragmatic backup key for P when using other layouts than Colemak. For instance, some virtual machines read raw input from the keyboard, but the scancode map still applies.
  • Moves Left Shift to Less Than (at the right of Left Shift on pc-105 keyboards).
    This eases the strain on the left little finger.
  • Copies Left Alt to Alt-Gr.
    This way, you can use both hands for the Alt modifier, which greatly reduces the strain on the hands. Generally, use the one hand for the key and the other hand for the modifier.
  • Moves Alt-Gr to the original position of Left Shift.
    Takes a little to get used to, but very handy when defining custom keybindings.

The format of the scancode map is pretty simple:

00,00,00,00, <- preamble
00,00,00,00,
08,00,00,00, <- number of remaining 4-tuples (end-sequence inclusive)
01,00,3a,00, <- swap Escape and Caps Lock
3a,00,01,00,
...
00,00,00,00  <- end-sequence

You can find more information on the scancode map format here, and a scan code reference here. Have fun…