From 7b303abd6ea4714d7863a18e41c6adb259d74e19 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Mon, 5 Dec 2016 16:36:05 +0100 Subject: [PATCH] even more yasnippets! - fixes for org-mode version 9 - snippets for sql-interactive-mode - some hidden snippets. sorry but this is private. Signed-off-by: Andreas Gerler --- bba.org | 10 ++++++++++ elpa/yasnippet-readme.txt | 2 +- snippets/eshell-mode/buffer-redirect | 4 ++-- snippets/org-mode/listsrcsh | 2 +- snippets/org-mode/sql | 7 +++++++ snippets/org-mode/sqlmysql | 7 +------ snippets/org-mode/sqlvertica | 7 +------ snippets/org-mode/srcclient | 2 +- snippets/org-mode/srcsession | 2 +- snippets/org-mode/srcsh | 2 +- snippets/org-mode/tablesrcsh | 2 +- snippets/org-mode/tablesrcshy | 2 +- snippets/sql-interactive-mode/current_epoch | 5 +++++ snippets/sql-interactive-mode/grants | 5 +++++ snippets/sql-interactive-mode/grants_resourcepool | 5 ----- snippets/sql-interactive-mode/nodes | 5 +++++ snippets/sql-interactive-mode/resources | 5 +++++ snippets/sql-interactive-mode/vertica_users | 2 +- snippets/sql-mode/.yas-parents | 1 + 19 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 snippets/org-mode/sql create mode 100644 snippets/sql-interactive-mode/current_epoch create mode 100644 snippets/sql-interactive-mode/grants delete mode 100644 snippets/sql-interactive-mode/grants_resourcepool create mode 100644 snippets/sql-interactive-mode/nodes create mode 100644 snippets/sql-interactive-mode/resources create mode 100644 snippets/sql-mode/.yas-parents diff --git a/bba.org b/bba.org index 2e432ef1..506a51dc 100644 --- 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] diff --git a/elpa/yasnippet-readme.txt b/elpa/yasnippet-readme.txt index 1f451576..1e4e1845 100644 --- a/elpa/yasnippet-readme.txt +++ b/elpa/yasnippet-readme.txt @@ -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 diff --git a/snippets/eshell-mode/buffer-redirect b/snippets/eshell-mode/buffer-redirect index c161efc9..ab4f3cde 100644 --- a/snippets/eshell-mode/buffer-redirect +++ b/snippets/eshell-mode/buffer-redirect @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: buffer-redirect -# key: buffer-redirect +# key: buf_ # To redirect output to an Emacs buffer # -- -> #$0 \ No newline at end of file +> #$0 \ No newline at end of file diff --git a/snippets/org-mode/listsrcsh b/snippets/org-mode/listsrcsh index 4575ae38..974ad2ec 100644 --- a/snippets/org-mode/listsrcsh +++ b/snippets/org-mode/listsrcsh @@ -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 index 00000000..af04c4dd --- /dev/null +++ b/snippets/org-mode/sql @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: sql +# key: sql_ +# -- +#+begin_src sql $0 + +#+end_src \ No newline at end of file diff --git a/snippets/org-mode/sqlmysql b/snippets/org-mode/sqlmysql index e1b1e461..18348869 100644 --- a/snippets/org-mode/sqlmysql +++ b/snippets/org-mode/sqlmysql @@ -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: diff --git a/snippets/org-mode/sqlvertica b/snippets/org-mode/sqlvertica index dbd23739..81a10bcf 100644 --- a/snippets/org-mode/sqlvertica +++ b/snippets/org-mode/sqlvertica @@ -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: diff --git a/snippets/org-mode/srcclient b/snippets/org-mode/srcclient index 39bce73c..4166dcda 100644 --- a/snippets/org-mode/srcclient +++ b/snippets/org-mode/srcclient @@ -2,6 +2,6 @@ # name: srcclient # key: