From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: how to insert a source template Date: Tue, 12 Apr 2011 15:31:24 -0400 Message-ID: <87fwpnxo4z.fsf@fastmail.fm> References: <874o64uf0p.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9jJ8-0006dV-P7 for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 15:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9jJ7-00019g-Pd for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 15:31:26 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:42802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9jJ7-00019c-Nh for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 15:31:25 -0400 In-Reply-To: <874o64uf0p.fsf@gmail.com> (Eric Schulte's message of "Tue, 12 Apr 2011 01:04:22 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org "Eric Schulte" writes: > Hi Petro, > > You can use yasnippet to expand keywords into templates (like code > blocks) with TAB, see the following for instructions on using yasnippet > with Org-mode [1]. > > Alternately you could add the following elisp code to your config, and > bind the `org-insert-block' function to a comfortable key combination. > > #+begin_src emacs-lisp > (defun org-insert-block (lang) > (interactive "Mlanguage: ") > (insert (format "#+begin_src %s\n \n#+end_src" lang)) > (goto-char (- (point) 10))) > #+end_src There is also a nice FAQ that outlines the various options: http://orgmode.org/worg/org-faq.html#shortcuts-for-entering-source-blocks Best, Matt