From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: keybinding help Date: Fri, 19 May 2006 15:54:42 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1148049644 7342 80.91.229.2 (19 May 2006 14:40:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 May 2006 14:40:44 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 19 16:40:44 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fh69Y-0004gu-Ex for geh-help-gnu-emacs@m.gmane.org; Fri, 19 May 2006 16:40:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fh69X-0001XA-SA for geh-help-gnu-emacs@m.gmane.org; Fri, 19 May 2006 10:40:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net 2jonpLgjmxyvmiyn8Ky6wAs6420fKWxqXo3uZqbMIzCjKMzTdN User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:3qhu2tdr5xX3ocS1Yx6vBVb5Mm0= Original-Xref: shelby.stanford.edu gnu.emacs.help:139525 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35150 Archived-At: "Ryan Krauss" 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.