]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
even more yasnippets!
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Mon, 5 Dec 2016 15:36:05 +0000 (16:36 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Mon, 5 Dec 2016 15:36:05 +0000 (16:36 +0100)
- fixes for org-mode version 9
- snippets for sql-interactive-mode
- some hidden snippets. sorry but this is private.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
19 files changed:
bba.org
elpa/yasnippet-readme.txt
snippets/eshell-mode/buffer-redirect
snippets/org-mode/listsrcsh
snippets/org-mode/sql [new file with mode: 0644]
snippets/org-mode/sqlmysql
snippets/org-mode/sqlvertica
snippets/org-mode/srcclient
snippets/org-mode/srcsession
snippets/org-mode/srcsh
snippets/org-mode/tablesrcsh
snippets/org-mode/tablesrcshy
snippets/sql-interactive-mode/current_epoch [new file with mode: 0644]
snippets/sql-interactive-mode/grants [new file with mode: 0644]
snippets/sql-interactive-mode/grants_resourcepool [deleted file]
snippets/sql-interactive-mode/nodes [new file with mode: 0644]
snippets/sql-interactive-mode/resources [new file with mode: 0644]
snippets/sql-interactive-mode/vertica_users
snippets/sql-mode/.yas-parents [new file with mode: 0644]

diff --git a/bba.org b/bba.org
index 2e432ef18e61d65b3692dc51d86f41795ad39dd3..506a51dcca00a7e07b1f58d88b38ce48a510854e 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -458,6 +458,10 @@ snippets for =aws cli= are awesome!
               "~/.emacs.d/elpa/yasnippet-20161110.1226")
   (require 'yasnippet)
   (setq yas-snippet-dirs '("~/.emacs.d/snippets"))
+
+  (if (equal "work" (getenv "SYSENV"))
+      (add-to-list 'yas-snippet-dirs "~/workorg/snippets"))
+
   (yas/reload-all)
   (yas-global-mode 1)
   (setq yas-indent-line nil)
@@ -506,6 +510,12 @@ Default to snippet-mode if we are in a sub directory of snippets:
   (add-to-list 'auto-mode-alist '("\\.emacs.d/snippets/[^/]*/" . snippet-mode))
 #+END_SRC
 
+We use lisp in our snippets. So suppress warnings for that:
+
+#+BEGIN_SRC emacs-lisp
+  (add-to-list 'warning-suppress-types '(yasnippet backquote-change))
+#+END_SRC
+
 * define some major modes for yasnippets
 [2016-05-25 Wed 10:26]
 
index 1f451576cfd9877fde11f589c098a4c8d5abe1b3..1e4e184545fec53624dfd815879d9aa3108e4a51 100644 (file)
@@ -98,4 +98,4 @@
   `custom-set-variables' is executed in your .emacs file.
 
   For more information and detailed usage, refer to the project page:
-     http://github.com/capitaomorte/yasnippet
+     http://github.com/joaotavora/yasnippet
index c161efc95de48ea93b6b13f42d2b9d977c4b99fe..ab4f3cdeb09cd307e92d046e55a0de84a2d8dfa8 100644 (file)
@@ -1,6 +1,6 @@
 # -*- mode: snippet -*-
 # name: buffer-redirect
-# key: buffer-redirect
+# key: buf_
 # To redirect output to an Emacs buffer
 # --
-> #<buffer ${1:*test*}>$0
\ No newline at end of file
+> #<buffer *${1:test}*>$0
\ No newline at end of file
index 4575ae3864d7baa6daffa33ed53bd77c26698fe6..974ad2ecf6a8b420e869eec70e34fad757ec6b6c 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 sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1 :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+#+BEGIN_SRC shell ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1 :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
   for i in \$\{$6\}; do
     echo "----------------------------------------"
     echo \$\{i\}
diff --git a/snippets/org-mode/sql b/snippets/org-mode/sql
new file mode 100644 (file)
index 0000000..af04c4d
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: sql
+# key: sql_
+# --
+#+begin_src sql $0
+
+#+end_src
\ No newline at end of file
index e1b1e461b715da704e5556f9be3e235242898fe9..1834886966016aca794fb6d8cda8b67381b006f2 100644 (file)
@@ -4,12 +4,7 @@
 # key: sqlmysql
 # --
 :PROPERTIES:
-:engine: mysql
-:dbhost: ${1:localhost}
-:dbuser: ${2:user}
-:dbpassword: (concat ${3:bba-db})
-:database: ${4:mysql}
-:cmdline: --protocol=tcp
+:header-args:sql: :engine mysql :dbhost ${1:localhost} :dbuser ${2:user} :dbpassword (concat ${3:bba-db}) :database ${4:mysql} :cmdline --protocol=tcp
 :exports: both
 :END:
 
index dbd23739bd411cc1053819ab11847543d990385a..81a10bcff9599488f7b6ef1af36493646c5914f4 100644 (file)
@@ -4,13 +4,8 @@
 # key: sqlvertica
 # --
 :PROPERTIES:
-:engine: vertica
-:dbhost: ${1:localhost}
-:dbuser: ${2:user}
-:dbpassword: (if (boundp '${3:bba-db})(concat $3))
-:database: ${4:$2}
+:header-args:sql: :engine: vertica :dbhost: ${1:localhost} :dbuser: ${2:user} :dbpassword: (if (boundp '${3:bba-db})(concat $3)) :database: ${4:$2}
 :exports: both
-:dbprologue: "\\a"
 :eval: never-export
 :END:
 
index 39bce73cd0a4f9159caa3fb15ba41e4bd1ebb376..4166dcdaeb6f7aa9a79c9470fd1de65d67369953 100644 (file)
@@ -2,6 +2,6 @@
 # name: srcclient
 # key: <sclient
 # --
-#+BEGIN_SRC sh :session ${1:client} :results ${2:$$(yas-choose-value '("verbatim drawer" "silent"))}
+#+BEGIN_SRC shell :session ${1:client} :results ${2:$$(yas-choose-value '("verbatim drawer" "silent"))}
 $0
 #+END_SRC
\ No newline at end of file
index eeb772741d7e87bc031b84dcb9ee2fd5fb2cd978..86f36d6c7a68820d6d67293d1c2a0a1f341dc279 100644 (file)
@@ -5,6 +5,6 @@
 # --
 Create a session for Emacs:
 
-#+BEGIN_SRC sh :session ${1:client} :results silent
+#+BEGIN_SRC shell :session ${1:client} :results silent
 ssh $0
 #+END_SRC
index 9c61ff5e791156ec53a721a0f9e40b3542796b9e..7e6bc9cff4cb2b071095ec9b33172d53e7b09134 100644 (file)
@@ -4,6 +4,6 @@
 # If you want to reference the output in other src blocks you need a name.
 # --
 ${1:#+NAME: $2}
-#+BEGIN_SRC sh ${3::session ${4:client}} :cache ${5:$$(yas-choose-value '("yes" "no"))} :results ${6:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+#+BEGIN_SRC shell ${3::session ${4:client}} :cache ${5:$$(yas-choose-value '("yes" "no"))} :results ${6:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
   $0
 #+END_SRC
\ No newline at end of file
index 118a65fa159b3baad087de0ac97b10b993bec1ee..c249c7223e88fa75856411bb40cda89c532ba985 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 sh ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1[,0] :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+#+BEGIN_SRC shell ${4::session ${5:client}} :var ${6:HOSTS$(upcase (yas-text))}=$1[,0] :cache ${7:$$(yas-choose-value '("yes" "no"))} :results ${8:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
 $6=($$6)
 
 for INDEX in \$\{!$6[@]\}; do
index c85d626fbd57b3d35bef21837b8c41746abb279e..3a7e6bbdb2aeb0bc085c8520dc9645f285aa2758 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 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"))}
+#+BEGIN_SRC shell ${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
diff --git a/snippets/sql-interactive-mode/current_epoch b/snippets/sql-interactive-mode/current_epoch
new file mode 100644 (file)
index 0000000..b0148e7
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: current_epoch
+# key: epo_
+# --
+SELECT current_epoch, ahm_epoch, last_good_epoch FROM v_monitor.system;
\ No newline at end of file
diff --git a/snippets/sql-interactive-mode/grants b/snippets/sql-interactive-mode/grants
new file mode 100644 (file)
index 0000000..49c3ab7
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# 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
diff --git a/snippets/sql-interactive-mode/grants_resourcepool b/snippets/sql-interactive-mode/grants_resourcepool
deleted file mode 100644 (file)
index 3205b92..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: grants_resourcepool
-# key: grares_
-# --
-SELECT grantee, object_name FROM grants WHERE object_type = 'RESOURCEPOOL' ORDER BY grantee LIMIT 50;
\ No newline at end of file
diff --git a/snippets/sql-interactive-mode/nodes b/snippets/sql-interactive-mode/nodes
new file mode 100644 (file)
index 0000000..77160e3
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: nodes
+# key: nodes_
+# --
+SELECT * FROM nodes;
\ No newline at end of file
diff --git a/snippets/sql-interactive-mode/resources b/snippets/sql-interactive-mode/resources
new file mode 100644 (file)
index 0000000..ba97ac8
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: resources
+# key: res_
+# --
+SELECT * FROM ${1:$$(yas-choose-value '("resource_pool_status" "resource_pool_move" "resource_rejections" "resource_rejection_details ORDER BY 1"))};$0
\ No newline at end of file
index 6fdaff033c1e2b8c82a82ea7f0dfdf13c8bb3866..030a4455ee7a2ad5a33648c3c6a2f54f6b147c26 100644 (file)
@@ -2,4 +2,4 @@
 # name: vertica_users
 # key: vertu_
 # --
-SELECT user_name,resource_pool,default_roles FROM users ORDER BY 1;
\ No newline at end of file
+SELECT user_name,resource_pool,default_roles FROM v_catalog.users ORDER BY 1;
\ No newline at end of file
diff --git a/snippets/sql-mode/.yas-parents b/snippets/sql-mode/.yas-parents
new file mode 100644 (file)
index 0000000..a20f5c6
--- /dev/null
@@ -0,0 +1 @@
+sql-interactive-mode