24 July 2007

my dot emacs: Shift to Control

I can still remember my left pinky hurting badly, from
pressing the Control key to invoke commands in Emacs.
But then I swapped Shift & Control. And I've been
happy ever since. Shift is in a perfect location
(not too far below like Control)
and is on both sides of the keyboard -- this even
on the worst keyboards that I had to endure while
in college.

Now, some things break when you do this.
Control-Space sets the mark (and still
does), but Shift-Space doesn't -- it
simply inserts a space. Control-G can break
out of infinite loops in Emacs Lisp -- Shift-g
can't do that (unless you modify the quit_char
in src/keyboard.c before building Emacs). Also,
typing upcase or capitilized characters are a
bit harder -- especially because I move my
entire hand off the keyboard to hit the Control
key -- no more use of the pinky in unnatural
positions! And when you cut-n-paste, upper
case characters run commands!! (Although,
I haven't needed it, this shouldn't be too hard
to overcome -- you can setup things so that
a keypress swaps Control & Shift, and then
pastes the contents of the clipboard,
and the re-swaps them again.)

Despite the problems, this has been worth
it for me. And here is the code for all this.
I think this is all the code -- I haven't really looked at
it since I wrote it about 6 years ago. This
works on both Windows and Linux (I think, this will
really work everywhere...):

These days I run Emacs via Putty from a Windows machine.
This is how I cut-n-paste in Putty -- when you right click
on the terminal, Putty sends the contents of the clipboard
to the terminal. There are 2 parts to this: the Emacs part
and the shell part. First, I have to suspend Emacs and
go to the shell, where is type the alias c: