emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] paste from clip to code block


From: Jorge A. Alfaro-Murillo
Subject: Re: [O] paste from clip to code block
Date: Fri, 17 Apr 2015 11:08:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

John Kitchin writes:

I like this kind of keyboard shortcut: For python: <p TAB C-w For emacs-lisp <el TAB C-w

I agree, this is the best method. Although probably you mean C-y instead of C-w.

For the record, this requires you to set up `org-structure-template-alist' to include python and emacs-lisp. For example, I use p and E, for python and emacs-lisp, so in my .emacs I have:

#+BEGIN_SRC emacs-lisp
 (eval-after-load "org"
        '(progn
           (add-to-list 'org-structure-template-alist
                        '("E"
                          "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"
"<src lang=\\"emacs-lisp\\">\n\n?</src>"))
           (add-to-list 'org-structure-template-alist
                        '("p"
                          "#+BEGIN_SRC python\n?\n#+END_SRC"
"<src lang=\\"python\\">\n\n?</src>"))))
#+END_SRC

I even use the method in message-mode, for writing emails with code, like I just did now =)

Best,

--
Jorge.




reply via email to

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