all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Simple keybinding request
Date: Sat, 22 Apr 2017 02:59:39 +0200	[thread overview]
Message-ID: <yw.867f2ddzpg.fsf@zoho.com> (raw)
In-Reply-To: 87d1clhp69.fsf@skimble.plus.com

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
"refn".

Or, you can do it manually, like this:

    (defun insert-ref-name ()
      (interactive)
      (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
http://user.it.uu.se/~embe8573




      parent reply	other threads:[~2017-04-22  0:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09 10:05 Simple keybinding request Sharon Kimble
2017-04-09 10:22 ` Danny YUE
2017-04-09 13:03   ` Sharon Kimble
2017-04-09 16:12     ` Danny YUE
2017-04-09 11:46 ` Yuri Khan
2017-04-09 12:49   ` Sharon Kimble
2017-04-22  0:59 ` Emanuel Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw.867f2ddzpg.fsf@zoho.com \
    --to=moasen@zoho.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.