[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs command frequencies:

From: Xah
Subject: Re: Emacs command frequencies:
Date: Wed, 12 Nov 2008 20:07:28 -0800 (PST)
User-agent: G2/1.0

Hi Nikolaj,

Interesting thoughts.

On Nov 12, 3:28 am, Nikolaj Schumacher <address@hidden> wrote:
> Xah<address@hidden> wrote:
> > here's my top commands... started maybe few months ago.
> Some notes on this.  (Some opinions, and some theses.  The latter
> will point to some missing data that could influence the
> interpretation.)
> - Clearly some individual commands are very common and need to be comfortable.
> - Some commands are infrequent enough, that making them comfortable would
> be a waste of time.  One could argue that they should be focused on
> being easy to remember.  I think that are probably all those beyond the
> top 25.
> - I am very careful when rebinding default keys.  Not because I think the
> defaults are excellent, but because once you rebind one, you likely have
> to rebind many more.  Unfortunately, this makes rebinding common keys
> less worthwhile.  You can't just rebind the top 25, you'll have to
> rebind many more.  If you want to use M-x or C-c, it would even be
> thousands.

somehow i solved this. I've been using my ergonomic binding map for
about 2 years now. In the beginning several of modes override my keys,
and then i wasn't sure how to reclaim them with hook, especially in
more fundamental modes like minibuffer, shell, isearch. I pretty much
just accepted these inconveniences. I just used the default binding or
physical keys when in minibuffer. Overall, i'm still much happier
because most of the time keystroke happens not in these special modes.

But it turned out to be quite simple to solve them with a hook as my
elisp knowledge increased. Of course one worries about consequences of
rebinding keys in minibuffer... but actually not problem has turned
up. One may worry that modes will constantly reclaim keybindings but
actually not so. Occationally a mode will reclaim about 2 or 3 in the
Meta+‹letter› space, that is easily fixed with a hook. Now with
experience, the these keys are very predicable (thanks to emacs
keybinding convention)

and recently i learned that minor mode takes precedence over global
keymap... so in the very near future i'll make my ergo map a minor
mode which should avoid many hooks.

(for those who wants to try, the elisp code is here:

> - A very important aspect is repeated keystrokes.  Clearly, a lot of
> next-lines are consecutive, meaning they are easier to type the second
> time around.  So as far as finger strain goes, they're slightly
> over-represented in the statistic.


> - Commands that are repeated frequently should have the highest priority
> for one-button keys.


> That's why I personally think save-buffer and
> kill-this-buffer would be a waste for single keys.

I think there are sufficient availale simple shortcut positions to
allow these common commands to have a easy shortcut.

there are some 26 simple Meta+key positions and another 26 Ctrl+key
positions. Counting the top number keys and other misc symbol keys
would add about 15 to each. Now if you look at the most used
commands... the top 5 or 6 makes up a big majority... then the rest
commands gradual out. There is only one sharp gap after top 10th
command or so.

in fact, with my ergo map, since most frequently used commands are now
on the Meta+key space, the Ctrl+key space is pretty much empty now.
So, commands like Open, Close, Save, now go there with modern stardard
shortcuts with Ctrl.

(i put frequently used commands on the Alt+‹ke› space instead of Ctrl
+‹key› space is because in general Alt is easier to press than Ctrl
because Alt is right under thumb, involving a natural inward curl of
the thumb, while Ctrl is pinky, involving some un-natural stretch or
bending of the pinky, further, thumb is the most powerful finger,
pinkie the weakest.)

so, on one hand i have most used commands in the most easy to press
Alt space, on the other hand we can support the standard shortcuts for
Open, Save, Close, Print in the Ctrl space.

this is like 2 birds with one shot.

> On the other hand
> other-window has a terrible default for the same reason.


> - There are also commands that presumably appear in groups.  Clearly this
> is the case for letter input.  You'll often type hundreds of them in a
> row without using anything else.  And you do so with a high speed.  So
> it's important that they go well with each other.  The same goes for
> navigation commands.  They are often used in rapid succession and should
> be usable without much finger movement.

Yeah. The cursor keys.

I have the cursor keys under the right hand home position. And the
other group is delete single char left/right, and delete word left/
right, which i have on the left hand on D F E R keys with Alt. Another
group is copy cut paste undo, which is the Z X C V keys. I have them
with Alt, but with Ctrl can also be supported to be compatible with
modern standards. The drawback is of course duplication, but we have
enough spaces. In my ergo map, some 70% of Ctrl+letter positions are
empty. (one could consider moving many “Ctrl+key key” sequence into
“Ctrl+key” space but that calls more extensive remapping)

> Other commands (like
> save-buffer or find-file) are usually executed on their own, during
> typing pauses.  That's why I think they can get away with a less
> comfortable shortcut, while some less used commands should take priority.
> - Another possible conclusion to draw from high frequency of certain
> commands (especially if repeated often), is that they aren't efficient.
> That's why I replaced most of my usage of other-window with my
> window-numbering-mode.  It replaces several invocations by a single one.
> I often feel I should use next-line with a prefix, but holding my finger
> on C-n is so much less trouble.  (That's why I was thrilled to find
> move-to-window-line recently.  It saves me about 10-30 C-n each time I use
> it.)

one thing i noticed is that, although emacs has extensive number of
shortcuts (about 700), from my observation of emacs users in online
forums or irc thru my now 10 years of emacs using, and from my own
experience and study on emacs keybinding and system in the past 3
years, i find that vast majority of dedicated emacs users (say, over 2
years of emacs using in full time day job), do not use most of these.
Maybe using them once in few months. A few emacs users may use
particular command, but others never did.

Put in simple words, vast majority of emacs users do not use or know
vast majority of existing keybindings. There are only maybe less than
30 keybindings that are commonly used daily by all.

> And don't forget about backspace and return.  Those are some terrible keys.
> (At least those L-shaped return keys.)  I've replaced them with C-h and
> C-m and couldn't be happier.

ultimately, when studying keyboard shortcut in depth, one runs into
the design problems of the keyboard's physical layout itself. For
example, the Backspace, Enter keys as you cited, among others. The
Kinesis keyboard fixed these problems. For example, it has about 4
keys for each thumb in location below a PC keyboard's space bar. They
are used for Backspace, Enter, Alt, Ctrl, Page Up/Down, Home/End. (as
far as i know it is patented, and is the reason i guess no other
keyboard manufacture followed, in particular Microsoft, of which is
rather innovative in keyboard design)

• “Keyboard Hardware Design Flaws”

• A Review of The Microsoft Natural Ergonomic Keyboard 4000

> The same goes for the keys between 0 and
> backspace.  On my dvorak layout those are [{ and ]}, and I've moved them
> to alt+, alt+., alt+/, alt+= system-wide.  I've also switched ( and )
> with < and >.  This really helps "the weakest finger".

my own solution for these, is to have map them in the Hyper key space
with right hand's homerow keys. The hyper is the Windows key on my
Microsoft keyboard used with Mac OS X.

For example, i have these (with dvorak layout):

(global-set-key (kbd "H-d") (lambda () (interactive) (insert "«»")
(backward-char 1)))
(global-set-key (kbd "H-h") (lambda () (interactive) (insert "{}")
(backward-char 1)))
(global-set-key (kbd "H-t") (lambda () (interactive) (insert "()")
(backward-char 1)))
(global-set-key (kbd "H-n") (lambda () (interactive) (insert "[]")
(backward-char 1)))
(global-set-key (kbd "H-s") (lambda () (interactive) (insert "“”")
(backward-char 1)))

(global-set-key (kbd "H-D") (lambda () (interactive) (insert "‹›")
(backward-char 1)))
(global-set-key (kbd "H-T") (lambda () (interactive) (insert "『』")
(backward-char 1)))
(global-set-key (kbd "H-N") (lambda () (interactive) (insert "「」")
(backward-char 1)))
(global-set-key (kbd "H-S") (lambda () (interactive) (insert "‘’")
(backward-char 1)))

(global-set-key (kbd "H-g") (lambda () (interactive) (insert "+")))
(global-set-key (kbd "H-c") (lambda () (interactive) (insert "=")))
(global-set-key (kbd "H-r") (lambda () (interactive) (insert "\"\"")
(backward-char 1)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]