]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
yasnippets for everything
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Wed, 10 May 2017 08:39:35 +0000 (10:39 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Wed, 10 May 2017 08:39:35 +0000 (10:39 +0200)
* fixes for org-mode, sql-interactive, eshell
* fix for shell script template
* new json-mode parameter-key-value for aws cloudformation parameter files.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
snippets/eshell-mode/aws-filters
snippets/json-mode/parameter-key-value [new file with mode: 0644]
snippets/org-mode/results
snippets/org-mode/tablesrcsh
snippets/org-mode/tablesrcshy
snippets/sql-interactive-mode/grants
templates/default-sh.sh

index 0a775d96c67d9333b3b9928742d37665b73f9e67..9ba8ff708f8adc53c153dd67e676bf030b9e2cd1 100644 (file)
@@ -2,4 +2,4 @@
 # name: aws-filters
 # key: awsfil
 # --
---filters "Name=${1:$$(yas-choose-value '("tag:Name" "tag:Project" "tag:Type" "tag:Cluster" "instance.group-id" "private-ip-address" "description"))},Values=$2" $0
\ No newline at end of file
+--filters "Name=${1:$$(yas-choose-value '("tag:Name" "tag:Project" "tag:Type" "tag:Cluster" "instance.group-id" "private-ip-address" "network-interface.subnet-id" "description"))},Values=$2" $0
\ No newline at end of file
diff --git a/snippets/json-mode/parameter-key-value b/snippets/json-mode/parameter-key-value
new file mode 100644 (file)
index 0000000..01858fc
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: parameter-key-value
+# key: pmk_
+# expand-env: ((yas/indent-line 'auto) (yas/wrap-around-region 't))
+# --
+{
+ "ParameterKey": "$1",
+ "ParameterValue": "$2"
+},$0
\ No newline at end of file
index 805afd76eb671a909d681edd5bd8b74365cfb3cc..1ef396444fbe34b962ce92bea23c2ef59bffd748 100644 (file)
@@ -3,4 +3,4 @@
 # key: :res
 # add results parameter to src block
 # --
-:results ${1:$$(yas-choose-value '("verbatim drawer" "table" "list" "silent" "value code :wrap SRC sql"))} $0
\ No newline at end of file
+:results ${1:$$(yas-choose-value '("verbatim drawer" "table" "list" "silent" "value code :wrap SRC sql" "value code :wrap SRC json"))} $0
\ No newline at end of file
index f6e37e2ec5387d9abc04cf41f83fde94bccc2a1a..3f7693aebecdbc27df44fb1d10360c02199960be 100644 (file)
@@ -7,7 +7,7 @@
 | $0 |
 
 ${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 shell ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1[,0] :cache ${7:$$(yas-choose-value '("yes" "no"))} ${8::res}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1[,0] :cache ${7:$$(yas-choose-value '("yes" "no"))} ${8::res}
 $6=($$6)
 
 for INDEX in \$\{!$6[@]\}; do
index b87537eb7ba0bacf42d9402bd611754defd6e646..ea6a59537036bd8467f97f991aea3e663ac27a3d 100644 (file)
@@ -4,7 +4,7 @@
 # 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 shell ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=${1:`(yank)`}[,${7:0}] :cache ${8:$$(yas-choose-value '("yes" "no"))} ${9::res}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=${1:`(yank)`}[,${7:0}] :cache ${8:$$(yas-choose-value '("yes" "no"))} ${9::res}
 $6=($$6)
 
 for INDEX in \$\{!$6[@]\}; do
index 49c3ab7b4e060578db66be281098bce291cd3800..e770e3f91a628044bf50fced2ea36c5edd27c25e 100644 (file)
@@ -2,4 +2,4 @@
 # name: grants
 # key: grants_
 # --
-SELECT grantee, object_name FROM v_catalog.grants WHERE object_type = '${1:$$(yas-choose-value '("RESOURCEPOOL" "ROLE" "SCHEMA" "TABLE" "STORAGELOCATION"))}' ORDER BY grantee $0LIMIT 50;
\ No newline at end of file
+SELECT grantee, object_name, privileges_description FROM v_catalog.grants WHERE object_type = '${1:$$(yas-choose-value '("RESOURCEPOOL" "ROLE" "SCHEMA" "TABLE" "VIEW" "STORAGELOCATION"))}' ORDER BY grantee $0LIMIT 50;
\ No newline at end of file
index ada6b5dc517835e3f582efa3e4804e0d627a9bdb..c70f2dfd2893896871021b6a7dbd3bbe4ec61db4 100755 (executable)
@@ -13,8 +13,8 @@
 
   `(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`
 
- --help, -h   for help
- --man,  -m   to get this man page.
+ --help, -h    for help
+ --man,  -m    to get this man page.
  --verbose, -v be more verbose.
 
 =head1 EXAMPLES
 
 
 # parse parameters
-TEMP=\`getopt -o mhvp --long man,help,verbose,password -n '`(downcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`' -- "$@"\`
+TEMP=\`getopt -o mhvp: --long man,help,verbose,password: -n '`(downcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`' -- "$@"\`
+
+if [ $? != 0 ]; then echo "Wrong parameters..." >&2; exit 1; fi
+
+eval set -- "$TEMP"
 
 while true; do
     case "\$1" in