[Top][All Lists]

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

Re: Simple keybinding request

From: Emanuel Berg
Subject: Re: Simple keybinding request
Date: Sat, 22 Apr 2017 02:59:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Sharon Kimble wrote:

> How can I bind '<ref name="%"/>' to some keys
> to make it easier to enter please?

You can use a simpler method than the snippet
expansion stuff in the Emacs abbrevs.
You probably know how to do that but if not,
ask. For example, you could set it up to

Or, you can do it manually, like this:

    (defun insert-ref-name ()
      (insert "<ref name=\"%\"/>") )
    (global-set-key "\C-\M-]" #'insert-ref-name)

> I've got it as a yasnippet but its using 5
> keys to enter it, and if I can just use say 3
> keys it will speed things up.

Well, counting keys don't tell the whole story.
If you want to minimize the keydowns, a command
is the best.

Also, as always, it is not the number of
keydowns as much as where those keys are on
the keyboard. Typing "asd" is faster that
hitting F9, and not only "isolated" but also in
terms of flow because F9 requires resetting the
hands to "asd" and "jkl" positions!

The abbrev solution is probably the best in
terms of all of it, super-easy to setup, quick
to execute and non-disruptive as the typing
goes on and on...

underground experts united

reply via email to

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