]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
the world needs more yasnippets!
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 25 Nov 2016 16:05:51 +0000 (17:05 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 25 Nov 2016 16:05:51 +0000 (17:05 +0100)
- snippet for creating orgmode comments
- snippet to create a named table. name is yanked from killring.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
snippets/org-mode/comment [new file with mode: 0644]
snippets/org-mode/tablesrcshy [new file with mode: 0644]

diff --git a/snippets/org-mode/comment b/snippets/org-mode/comment
new file mode 100644 (file)
index 0000000..4ea55d9
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: comment
+# key: <C
+# --
+#+BEGIN_COMMENT
+$0
+#+END_COMMENT
\ No newline at end of file
diff --git a/snippets/org-mode/tablesrcshy b/snippets/org-mode/tablesrcshy
new file mode 100644 (file)
index 0000000..c85d626
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- mode: snippet -*-
+# name: tablesrcshy (yank)
+# key: <srcshtabley
+# If you want to reference the output in other src blocks you need a name.
+# --
+${2:#+NAME: ${3:`(replace-regexp-in-string "[: \"]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil t "/"  t))))`-src}}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=${1:`(yank)`}[,${7:0}] :cache ${8:$$(yas-choose-value '("yes" "no"))} :results ${9:$$(yas-choose-value '("verbatim drawer" "table" "list" "value code :wrap SRC sql"))}
+$6=($$6)
+
+for INDEX in \$\{!$6[@]\}; do
+    echo \$\{$6[$\{INDEX\}]\}$0
+  done
+#+END_SRC