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: Xebar Saram
Subject: Re: [O] paste from clip to code block
Date: Fri, 17 Apr 2015 17:36:06 +0300

thx john

that are very helpful tips!

Z

On Fri, Apr 17, 2015 at 4:56 PM, John Kitchin <address@hidden> wrote:
I like this kind of keyboard shortcut:

For python:
<p TAB C-w

For emacs-lisp

<el TAB C-w

What else would you want?

If you like yasnippets, you could do this:

# -*- mode: snippet; require-final-newline: nil -*-
# --

#+begin_src python
`(yank)`
#+end_src

$0

Or some kind of lisp function like:
#+BEGIN_SRC emacs-lisp
(defun paste-python-code ()
  (interactive)
  (insert "#+BEGIN_SRC python\n")
  (yank)
  (insert "\n#+END_SRC"))
#+END_SRC

I guess you need one of these for every language type.
Xebar Saram writes:

> Hi all
>
> i was wondering if anyone has every created a function to auto paste what
> in the sysclip/emas clip into org but as a formatted code block?
> any clue anyone?
>
> best
>
> Z

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


reply via email to

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