[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] how to insert a source template
From: |
Matt Lundin |
Subject: |
Re: [O] how to insert a source template |
Date: |
Tue, 12 Apr 2011 15:31:24 -0400 |
User-agent: |
Gnus/5.110015 (No Gnus v0.15) Emacs/23.3 (gnu/linux) |
"Eric Schulte" <address@hidden> 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