Archive for the ‘emacs’ Category

A year of living vi-rously

Tuesday, January 31st, 2012

For reasons which are not apparent* even to myself (although I suspect it had to do with general contrariness mixed with regret for some arrogant comments from the past) I spent 2011 emacs-free. More than that, I spent it using only vi (or, rather, vim) to do my text – including program text – editing. Since I couldn’t get SLIMV to work at the beginning of 2011 – it is in much better shape now – I even gave up the wonder that is Slime/Swank.

I can report that, even for a duffer like me, it is possible to develop very efficiently with vi(m) and a repl running in another terminal. So there, old-splittist!

And just to make sure I’m not making any forward progress, I’ve switched back to emacs for 2012. Now my buffers are full of “jjjj” and “kkkk”…

* I do this a lot, don’t I?

In praise of VBacs

Wednesday, January 9th, 2008

For my sins I spend most of the (work) day in Microsoft Word. In order to make this experience bearable I turn off as many of the automatic mangling features as I can and install VBacs, which provides a basic set of Emacs keybindings for Word. This means I can C-x C-f, C-x C-s, C-s, C-r, M-%, M-w, C-y etc. to my heart’s content. VBacs doesn’t turn Word into Emacs, but it does help me concentrate on changing the text rather than where simple keybindings might be.

VBacs – give it a go if you’re sentenced to Word.

PS. Does anyone have a programmatic way to replace the furshlugginer automatic numbering in a Word document with its textual equivalents? (That is, replace the automatically inserted numbering “1.13” with the text “1.13”.)

Emacs newbies – don’t swap Ctrl and Caps Lock

Monday, July 23rd, 2007

Newcomers to Common Lisp are encouraged to use Emacs (see also Finseth) so that they can use the fabulous Slime (and one should not forget paredit) as a development environment. Those that don’t insist they’ll stick with Vim (and then unaccountably fail to develop slim-vim), or try Cusp, will at some early point be advised to swap their Control and Caps Lock keys to save wear and tear on the pinkie. Even EmacsWiki points to typically forthright Steve Yegge piece which leads off with this advice.

I say – No. The proper place for the Control key is not “on the home row” but on each side of the Space Bar, where Tom
Knight and the mothership intended them to be. And outside the Control keys should be the Meta keys, and outside them should be the Super keys, and finally the Hyper keys. This allows for what I think is a very natural way of typing key-chords – the modifiers with one hand, and the letter/symbol with the other. These are, after all, the sorts of keyboards on which Emacs was first developed.

How you do this will depend on your OS and your keyboard. For Windows, you might like to start here or here.* In OSX you can look in System Preferences > Keyboard & Mouse > Modifier Keys. For Linux, there are a thousand xmodmap and xkb tutorials…

The other keyboard reconfiguration I recommend is, where possible, to put the parentheses on unshifted keys (swapping with the [square] brackets works on some keyboards). Of course, if, like me, you live/work in a locale with all manner of chicken scratchings on top of proper latin letters this may not be possible or convenient. (Eric Naggum’s more radical approach can be seen here.)

So, my advice for Emacs (Climacs, VBacs) newbies would be: don’t swap Caps-Lock and Control, swap Alt, Ctrl, Windows, Application, AltGr…


* For example, if my Windows XP notebook had the following key configuration to the left of the spacebar
(from right to left, inside to outside)
Alt Windows Ctrl and I wanted it to be Ctrl Alt Windows, I would do the following:

  1. Fire up regedt32.exe and navigate to HKEY_CURRENT_USER\Keyboard Layout.
  2. Create a new entry Scancode Map (using Edit > New > Binary Value).
  3. Edit the new entry (using Edit > Modify Binary Data) to contain the following:
        0000   00 00 00 00 00 00 00 00
        0008   04 00 00 00 1D 00 38 00
        0010   38 00 5B E0 5B E0 1D 00
        0018   00 00 00 00

    The table is in little-endian form. The first 8 bytes are header (all zeroes). The next four bytes contain the count of entries (4, including the sentinel). The three following four byte entries swap Left Alt (0x38) with Left Ctrl 0x1D), Left Win (0xE058) with Left Alt, and Left Ctrl with Left Win. The last 4 bytes are a null terminator/sentinel.

  4. Close up, log off, log on, and enjoy.

If you did this, of course, it would be entirely at your own risk.

… on a stick

Sunday, November 5th, 2006

Climacs on Windows

What do you get when you put SBCL‘s windows port (helpfully packaged by Nikodemus Siivola), EmacsW32, Slime, McClim and Xming on a USB stick?

A nice little portable development environment with cross-platform GUI, of course!