Hi
so first ive been using yankpad as a quick way to add, convert and process org-mode code blocks and i love it. i thought that this could be a nice addition to the wiki (i can add it myself if you want and approve)
So what i do is this:
i have yasnippet set to
;; default to wrap
(setq yas-wrap-around-region t)
then i have the following snippet
*** pbash: paste with clipboard data :key:pb:
#+BEGIN_SRC sh :results none
$0
#+END_SRC
now i can mark a line region ,activate the snippet and voila the line is wraped in a orgmode block
neat :)
i extended this to many languages and types of blocks
i also have similar code to paste a already copied to clip text into an org block using yasnippet magic
*** pcbash: paste with clipboard data :key:pcb:
#+BEGIN_SRC sh :results none
`(yank)` $0
#+END_SRC
Finally a question or feedback from anyone. can one modify the first script that of the region is active/selected it would wrap the region as it does currently BUT if nothing is selected it would wrap the current line?
Hi so first ive been using yankpad as a quick way to add, convert and process org-mode code blocks and i love it. i thought that this could be a nice addition to the wiki (i can add it myself if you want and approve)
So what i do is this:
i have yasnippet set to
then i have the following snippet
now i can mark a line region ,activate the snippet and voila the line is wraped in a orgmode block neat :) i extended this to many languages and types of blocks
i also have similar code to paste a already copied to clip text into an org block using yasnippet magic
Finally a question or feedback from anyone. can one modify the first script that of the region is active/selected it would wrap the region as it does currently BUT if nothing is selected it would wrap the current line?
best
Z