help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: keybinding help


From: Mathias Dahl
Subject: Re: keybinding help
Date: Fri, 19 May 2006 15:54:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

"Ryan Krauss" <ryanlists@gmail.com> writes:

> I know this is a simple question, but I can't seem to find the answer.
> I want to bind a key to insert some text that I am retyping a lot.
> How do I do that?  I would like to bind C-c l to insert that text
> '\lstinline!'.

I know you asked for a keybinding, and you have got a couple of
suggestions on how to that, but I wanted to also suggest that you try
the `abbrevs' functionality in Emacs. It is more general and you might
get ideas on other uses for it.

A simple example for you you test when you are in the buffer where you
wanted this key binding:

M-x define-mode-abbrev RET 1st RET \1stinline! RET

That defines a mode-specific abbreviation `1st', which will expand to
your text.

Next, enable `abbrev-mode' (if, that is, it isn't already enabled):

M-x abbrev-mode RET

Now type 1st and then a space (or return, or some other non-word
character).

When you exit Emacs it will ask you if you want to save the abbrevs
you have created.


reply via email to

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