From 7a5cc50bb3315dc3da128e0ac56a11a9af27beea Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Nov 2016 21:41:10 +0100 Subject: Add snippets --- emacs/.emacs.d/GNUmakefile | 17 +++++++- emacs/.emacs.d/snippets/.dir-locals.el | 2 + .../snippets/conf-mode/.yas-compiled-snippets.el | 8 ++++ emacs/.emacs.d/snippets/conf-mode/section | 8 ++++ .../snippets/css-mode/.yas-compiled-snippets.el | 8 ++++ emacs/.emacs.d/snippets/css-mode/box-shadow | 5 +++ .../emacs-lisp-mode/.yas-compiled-snippets.el | 9 ++++ emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on | 5 +++ emacs/.emacs.d/snippets/emacs-lisp-mode/face | 5 +++ .../snippets/haml-mode/.yas-compiled-snippets.el | 10 +++++ emacs/.emacs.d/snippets/haml-mode/faq | 12 +++++ .../snippets/html-mode/.yas-compiled-snippets.el | 12 +++++ emacs/.emacs.d/snippets/html-mode/block | 7 +++ emacs/.emacs.d/snippets/html-mode/for | 8 ++++ emacs/.emacs.d/snippets/html-mode/generic-block | 8 ++++ emacs/.emacs.d/snippets/html-mode/script | 5 +++ emacs/.emacs.d/snippets/html-mode/trans-with-cap | 6 +++ .../snippets/nxml-mode/.yas-compiled-snippets.el | 10 +++++ emacs/.emacs.d/snippets/nxml-mode/pencil-property | 7 +++ .../snippets/nxml-mode/pencil-property-value | 5 +++ emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut | 9 ++++ .../snippets/org-mode/.yas-compiled-snippets.el | 11 +++++ emacs/.emacs.d/snippets/org-mode/codeblock | 7 +++ emacs/.emacs.d/snippets/org-mode/heading | 9 ++++ emacs/.emacs.d/snippets/org-mode/project | 51 ++++++++++++++++++++++ emacs/.emacs.d/snippets/org-mode/snippet | 14 ++++++ .../snippets/php-mode/.yas-compiled-snippets.el | 10 +++++ emacs/.emacs.d/snippets/php-mode/function | 8 ++++ emacs/.emacs.d/snippets/php-mode/wpheader.php | 13 ++++++ .../snippets/python-mode/.yas-compiled-snippets.el | 15 +++++++ emacs/.emacs.d/snippets/python-mode/defm_empty | 7 +++ emacs/.emacs.d/snippets/python-mode/form | 9 ++++ emacs/.emacs.d/snippets/python-mode/form_valid | 8 ++++ .../snippets/python-mode/form_valid_with_return | 8 ++++ emacs/.emacs.d/snippets/python-mode/import_from | 6 +++ emacs/.emacs.d/snippets/python-mode/method | 7 +++ .../.emacs.d/snippets/python-mode/permission_guard | 9 ++++ emacs/.emacs.d/snippets/python-mode/url | 5 +++ .../snippets/ruby-mode/.yas-compiled-snippets.el | 18 ++++++++ emacs/.emacs.d/snippets/ruby-mode/ProductSeed | 5 +++ emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW | 5 +++ .../.emacs.d/snippets/ruby-mode/ProductSeedHWGroup | 8 ++++ emacs/.emacs.d/snippets/ruby-mode/describe | 7 +++ emacs/.emacs.d/snippets/ruby-mode/do | 6 +++ emacs/.emacs.d/snippets/ruby-mode/factory | 9 ++++ emacs/.emacs.d/snippets/ruby-mode/fill_in | 5 +++ emacs/.emacs.d/snippets/ruby-mode/mod | 11 +++++ emacs/.emacs.d/snippets/ruby-mode/reduce | 5 +++ .../snippets/twig-mode/.yas-compiled-snippets.el | 18 ++++++++ emacs/.emacs.d/snippets/twig-mode/_self | 5 +++ emacs/.emacs.d/snippets/twig-mode/blk | 7 +++ emacs/.emacs.d/snippets/twig-mode/def | 7 +++ emacs/.emacs.d/snippets/twig-mode/ext | 5 +++ emacs/.emacs.d/snippets/twig-mode/for | 7 +++ emacs/.emacs.d/snippets/twig-mode/if | 7 +++ emacs/.emacs.d/snippets/twig-mode/ife | 9 ++++ emacs/.emacs.d/snippets/twig-mode/iif | 5 +++ emacs/.emacs.d/snippets/twig-mode/imp | 7 +++ emacs/.emacs.d/snippets/twig-mode/mac | 7 +++ emacs/.emacs.d/snippets/twig-mode/set | 5 +++ 60 files changed, 530 insertions(+), 1 deletion(-) create mode 100644 emacs/.emacs.d/snippets/.dir-locals.el create mode 100644 emacs/.emacs.d/snippets/conf-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/conf-mode/section create mode 100644 emacs/.emacs.d/snippets/css-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/css-mode/box-shadow create mode 100644 emacs/.emacs.d/snippets/emacs-lisp-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on create mode 100644 emacs/.emacs.d/snippets/emacs-lisp-mode/face create mode 100644 emacs/.emacs.d/snippets/haml-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/haml-mode/faq create mode 100644 emacs/.emacs.d/snippets/html-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/html-mode/block create mode 100644 emacs/.emacs.d/snippets/html-mode/for create mode 100644 emacs/.emacs.d/snippets/html-mode/generic-block create mode 100644 emacs/.emacs.d/snippets/html-mode/script create mode 100644 emacs/.emacs.d/snippets/html-mode/trans-with-cap create mode 100644 emacs/.emacs.d/snippets/nxml-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/nxml-mode/pencil-property create mode 100644 emacs/.emacs.d/snippets/nxml-mode/pencil-property-value create mode 100644 emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut create mode 100644 emacs/.emacs.d/snippets/org-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/org-mode/codeblock create mode 100644 emacs/.emacs.d/snippets/org-mode/heading create mode 100644 emacs/.emacs.d/snippets/org-mode/project create mode 100644 emacs/.emacs.d/snippets/org-mode/snippet create mode 100644 emacs/.emacs.d/snippets/php-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/php-mode/function create mode 100644 emacs/.emacs.d/snippets/php-mode/wpheader.php create mode 100644 emacs/.emacs.d/snippets/python-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/python-mode/defm_empty create mode 100644 emacs/.emacs.d/snippets/python-mode/form create mode 100644 emacs/.emacs.d/snippets/python-mode/form_valid create mode 100644 emacs/.emacs.d/snippets/python-mode/form_valid_with_return create mode 100644 emacs/.emacs.d/snippets/python-mode/import_from create mode 100644 emacs/.emacs.d/snippets/python-mode/method create mode 100644 emacs/.emacs.d/snippets/python-mode/permission_guard create mode 100644 emacs/.emacs.d/snippets/python-mode/url create mode 100644 emacs/.emacs.d/snippets/ruby-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/ruby-mode/ProductSeed create mode 100644 emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW create mode 100644 emacs/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup create mode 100644 emacs/.emacs.d/snippets/ruby-mode/describe create mode 100644 emacs/.emacs.d/snippets/ruby-mode/do create mode 100644 emacs/.emacs.d/snippets/ruby-mode/factory create mode 100644 emacs/.emacs.d/snippets/ruby-mode/fill_in create mode 100644 emacs/.emacs.d/snippets/ruby-mode/mod create mode 100644 emacs/.emacs.d/snippets/ruby-mode/reduce create mode 100644 emacs/.emacs.d/snippets/twig-mode/.yas-compiled-snippets.el create mode 100644 emacs/.emacs.d/snippets/twig-mode/_self create mode 100644 emacs/.emacs.d/snippets/twig-mode/blk create mode 100644 emacs/.emacs.d/snippets/twig-mode/def create mode 100644 emacs/.emacs.d/snippets/twig-mode/ext create mode 100644 emacs/.emacs.d/snippets/twig-mode/for create mode 100644 emacs/.emacs.d/snippets/twig-mode/if create mode 100644 emacs/.emacs.d/snippets/twig-mode/ife create mode 100644 emacs/.emacs.d/snippets/twig-mode/iif create mode 100644 emacs/.emacs.d/snippets/twig-mode/imp create mode 100644 emacs/.emacs.d/snippets/twig-mode/mac create mode 100644 emacs/.emacs.d/snippets/twig-mode/set (limited to 'emacs') diff --git a/emacs/.emacs.d/GNUmakefile b/emacs/.emacs.d/GNUmakefile index e5171d4..bbe5a76 100644 --- a/emacs/.emacs.d/GNUmakefile +++ b/emacs/.emacs.d/GNUmakefile @@ -6,7 +6,8 @@ SITE_LISPS = $(addsuffix c,$(filter-out $(UNWANTED),$(wildcard site-lisp/*.el))) INIT_LISPS = $(addsuffix .elc,$(basename $(wildcard init/*.org))) VENDOR_DIRS = $(wildcard vendor-lisp/*) -all: $(SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) +.PHONE: all snippets +all: $(SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets %.el: %.org $(call tangle,emacs-lisp) @@ -28,3 +29,17 @@ $(AUTOLOADS_FILE): $(SITE_LISPS) @$(EMACS) -batch \ -eval "(setq generated-autoload-file \"$(CURDIR)/$@\")" \ -eval "(update-directory-autoloads \"$(CURDIR)/site-lisp/\")" + +### Snippets + +SNIPPET_DIRS = $(wildcard snippets/*) +COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS)) + +%/.yas-compiled-snippets.el: %/* + @echo -e "\e[36mYAS\e[0m $(CURDIR)/snippets" + @$(EMACS) -batch \ + -eval "(package-initialize)" \ + -l yasnippet \ + -eval "(yas-compile-directory \"$(CURDIR)/snippets\")" + +snippets: $(COMPILED_SNIPPETS) diff --git a/emacs/.emacs.d/snippets/.dir-locals.el b/emacs/.emacs.d/snippets/.dir-locals.el new file mode 100644 index 0000000..f88a6f9 --- /dev/null +++ b/emacs/.emacs.d/snippets/.dir-locals.el @@ -0,0 +1,2 @@ +((nil + (require-final-newline . nil))) diff --git a/emacs/.emacs.d/snippets/conf-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/conf-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..c0664cc --- /dev/null +++ b/emacs/.emacs.d/snippets/conf-mode/.yas-compiled-snippets.el @@ -0,0 +1,8 @@ +;;; Compiled snippets and support files for `conf-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'conf-mode + '(("Section" "Section \"$1\"\n Identifier \"$2\"\n $0\nEndSection\n" "Xorg Section" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/conf-mode/section" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/conf-mode/section b/emacs/.emacs.d/snippets/conf-mode/section new file mode 100644 index 0000000..55be8f8 --- /dev/null +++ b/emacs/.emacs.d/snippets/conf-mode/section @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Xorg Section +# key: Section +# -- +Section "$1" + Identifier "$2" + $0 +EndSection diff --git a/emacs/.emacs.d/snippets/css-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/css-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..16e5bf0 --- /dev/null +++ b/emacs/.emacs.d/snippets/css-mode/.yas-compiled-snippets.el @@ -0,0 +1,8 @@ +;;; Compiled snippets and support files for `css-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'css-mode + '(("boxshadow" "box-shadow: ${1:offset-x} ${2:offset-y}${3: [blur-radius]}${4: [spread-radius]}${5: [color]};" "box-shadow" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/css-mode/box-shadow" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/css-mode/box-shadow b/emacs/.emacs.d/snippets/css-mode/box-shadow new file mode 100644 index 0000000..82fe9d5 --- /dev/null +++ b/emacs/.emacs.d/snippets/css-mode/box-shadow @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: box-shadow +# key: boxshadow +# -- +box-shadow: ${1:offset-x} ${2:offset-y}${3: [blur-radius]}${4: [spread-radius]}${5: [color]}; \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/emacs-lisp-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/emacs-lisp-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..2eef2b1 --- /dev/null +++ b/emacs/.emacs.d/snippets/emacs-lisp-mode/.yas-compiled-snippets.el @@ -0,0 +1,9 @@ +;;; Compiled snippets and support files for `emacs-lisp-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'emacs-lisp-mode + '(("face" " `($1 ((t (${2::foreground} $0))))" "face" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/emacs-lisp-mode/face" nil nil) + ("do" "(depends-on \"$1\")$0" "depends-on" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on b/emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on new file mode 100644 index 0000000..4f99d92 --- /dev/null +++ b/emacs/.emacs.d/snippets/emacs-lisp-mode/depends-on @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: depends-on +# key: do +# -- +(depends-on "$1")$0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/emacs-lisp-mode/face b/emacs/.emacs.d/snippets/emacs-lisp-mode/face new file mode 100644 index 0000000..9fdbbb2 --- /dev/null +++ b/emacs/.emacs.d/snippets/emacs-lisp-mode/face @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: face +# key: face +# -- + `($1 ((t (${2::foreground} $0)))) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/haml-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/haml-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..121aadb --- /dev/null +++ b/emacs/.emacs.d/snippets/haml-mode/.yas-compiled-snippets.el @@ -0,0 +1,10 @@ +;;; Compiled snippets and support files for `haml-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'haml-mode + '(("faq" "%dt\n = link_to '#' do\n .expand_icon\n $1\n%dd\n %p\n $0" "FAQ Question & Answer" nil nil + ((yas-indent-line 'fixed)) + "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/haml-mode/faq" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/haml-mode/faq b/emacs/.emacs.d/snippets/haml-mode/faq new file mode 100644 index 0000000..4d1a9e2 --- /dev/null +++ b/emacs/.emacs.d/snippets/haml-mode/faq @@ -0,0 +1,12 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: FAQ Question & Answer +# key: faq +# expand-env: ((yas-indent-line 'fixed)) +# -- +%dt + = link_to '#' do + .expand_icon + $1 +%dd + %p + $0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/html-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/html-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..bd1aba1 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/.yas-compiled-snippets.el @@ -0,0 +1,12 @@ +;;; Compiled snippets and support files for `html-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'html-mode + '(("trans" "{% trans \"$1\"|capfirst %}" "trans with cap" pony-tpl-minor-mode nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/html-mode/trans-with-cap" nil nil) + ("script" "" "script" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/html-mode/script" nil nil) + ("%" "{% $1 %}\n $0\n{% end$1 %}" "Template Block" pony-tpl-minor-mode nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/html-mode/generic-block" nil nil) + ("for" "{% for $1 in $2 %}\n $0\n{% endfor %}" "for" pony-tpl-minor-mode nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/html-mode/for" nil nil) + ("block" "{% block $1 %}\n $0\n{% endblock %}" "block" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/html-mode/block" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/html-mode/block b/emacs/.emacs.d/snippets/html-mode/block new file mode 100644 index 0000000..6510011 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/block @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: block +# key: block +# -- +{% block $1 %} + $0 +{% endblock %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/html-mode/for b/emacs/.emacs.d/snippets/html-mode/for new file mode 100644 index 0000000..01d9c44 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# condition: pony-tpl-minor-mode +# -- +{% for $1 in $2 %} + $0 +{% endfor %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/html-mode/generic-block b/emacs/.emacs.d/snippets/html-mode/generic-block new file mode 100644 index 0000000..82d40c7 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/generic-block @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Template Block +# key: % +# condition: pony-tpl-minor-mode +# -- +{% $1 %} + $0 +{% end$1 %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/html-mode/script b/emacs/.emacs.d/snippets/html-mode/script new file mode 100644 index 0000000..e50dbf5 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/script @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: script +# key: script +# -- + \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/html-mode/trans-with-cap b/emacs/.emacs.d/snippets/html-mode/trans-with-cap new file mode 100644 index 0000000..4f20a33 --- /dev/null +++ b/emacs/.emacs.d/snippets/html-mode/trans-with-cap @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: trans with cap +# key: trans +# condition: pony-tpl-minor-mode +# -- +{% trans "$1"|capfirst %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/nxml-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/nxml-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..edc7fe1 --- /dev/null +++ b/emacs/.emacs.d/snippets/nxml-mode/.yas-compiled-snippets.el @@ -0,0 +1,10 @@ +;;; Compiled snippets and support files for `nxml-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'nxml-mode + '(("s" "\n $0\n" "Shortcut" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut" nil nil) + ("pv" "$2" "PropertyValue" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/nxml-mode/pencil-property-value" nil nil) + ("p" "$4" "PencilProperty" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/nxml-mode/pencil-property" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/nxml-mode/pencil-property b/emacs/.emacs.d/snippets/nxml-mode/pencil-property new file mode 100644 index 0000000..7fafcb8 --- /dev/null +++ b/emacs/.emacs.d/snippets/nxml-mode/pencil-property @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: PencilProperty +# key: p +# -- +$4 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/nxml-mode/pencil-property-value b/emacs/.emacs.d/snippets/nxml-mode/pencil-property-value new file mode 100644 index 0000000..5da3d10 --- /dev/null +++ b/emacs/.emacs.d/snippets/nxml-mode/pencil-property-value @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: PropertyValue +# key: pv +# -- +$2 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut b/emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut new file mode 100644 index 0000000..e760d27 --- /dev/null +++ b/emacs/.emacs.d/snippets/nxml-mode/pencil-shortcut @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Shortcut +# key: s +# -- + + $0 + \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/org-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..cefc1eb --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/.yas-compiled-snippets.el @@ -0,0 +1,11 @@ +;;; Compiled snippets and support files for `org-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'org-mode + '(("snippet" "#+TITLE: ${1:snippet-name}\n#+OPTIONS: toc:nil\n\n* $1\n\n ${2:A short description abount $1}\n\n #+BEGIN_SRC $3 :tangle yes\n$0\n #+END_SRC" "snippet" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/org-mode/snippet" nil nil) + ("project" "#+TITLE: ${1:project_name}\n#+LINK: src ${2:http://code.ryuslash.org/cgit.cgi/$3$1/}\n#+LINK: tar_gz $2${4:snapshot/$1-master}.tar.gz\n#+LINK: zip $2$4.zip\n#+STARTUP: showall\n\n#+begin_html\n \n \n#+end_html\n\n#+INCLUDE: \"dlmenu.inc\"\n\n* About\n\n ${5:A short description about $1}\n\n | $0Status | $6 |\n | Language | $7 |\n | License | ${8:GPLv3} |\n\n* Why?\n\n ${9:Why did you even think of writing $1?}\n\n* Features\n\n ${10:$1 does...}\n\n* Dependencies\n\n ${11:$1 needs to have...}\n\n* Download\n\n ${12:To download $1...}\n\n* Install\n\n ${13:To install $1...}\n\n* Usage\n\n ${14:Using $1...}" "project" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/org-mode/project" nil nil) + ("*" "${1:*} ${2:TODO} $3\n${1:$(make-string (length text) ?\\ )} :PROPERTIES:\n${1:$(make-string (length text) ?\\ )} :CATEGORY: $4\n${1:$(make-string (length text) ?\\ )} :END:\n${1:$(make-string (length text) ?\\ )} $0" "Heading" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/org-mode/heading" nil nil) + ("code" "#+begin_src $1\n $0\n#+end_src" "codeblock" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/org-mode/codeblock" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/org-mode/codeblock b/emacs/.emacs.d/snippets/org-mode/codeblock new file mode 100644 index 0000000..a200b08 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/codeblock @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: codeblock +# key: code +# -- +#+begin_src $1 + $0 +#+end_src \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/heading b/emacs/.emacs.d/snippets/org-mode/heading new file mode 100644 index 0000000..9d5451e --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/heading @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Heading +# key: * +# -- +${1:*} ${2:TODO} $3 +${1:$(make-string (length text) ?\ )} :PROPERTIES: +${1:$(make-string (length text) ?\ )} :CATEGORY: $4 +${1:$(make-string (length text) ?\ )} :END: +${1:$(make-string (length text) ?\ )} $0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/project b/emacs/.emacs.d/snippets/org-mode/project new file mode 100644 index 0000000..269d655 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/project @@ -0,0 +1,51 @@ +# -*- mode: snippet -*- +# name: project +# key: project +# -- +#+TITLE: ${1:project_name} +#+LINK: src ${2:http://code.ryuslash.org/cgit.cgi/$3$1/} +#+LINK: tar_gz $2${4:snapshot/$1-master}.tar.gz +#+LINK: zip $2$4.zip +#+STARTUP: showall + +#+begin_html + + +#+end_html + +#+INCLUDE: "dlmenu.inc" + +* About + + ${5:A short description about $1} + + | $0Status | $6 | + | Language | $7 | + | License | ${8:GPLv3} | + +* Why? + + ${9:Why did you even think of writing $1?} + +* Features + + ${10:$1 does...} + +* Dependencies + + ${11:$1 needs to have...} + +* Download + + ${12:To download $1...} + +* Install + + ${13:To install $1...} + +* Usage + + ${14:Using $1...} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/snippet b/emacs/.emacs.d/snippets/org-mode/snippet new file mode 100644 index 0000000..67f15d5 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/snippet @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: snippet +# key: snippet +# -- +#+TITLE: ${1:snippet-name} +#+OPTIONS: toc:nil + +* $1 + + ${2:A short description abount $1} + + #+BEGIN_SRC $3 :tangle yes +$0 + #+END_SRC \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/php-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/php-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..ba80240 --- /dev/null +++ b/emacs/.emacs.d/snippets/php-mode/.yas-compiled-snippets.el @@ -0,0 +1,10 @@ +;;; Compiled snippets and support files for `php-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'php-mode + '(("header" "/*\n * Plugin Name: $1\n * Plugin URI: $2\n * Description: $3\n * Version: ${4:1.0}\n * Author: ${5:Tom Willemse}\n * Author URI: ${6:https://ryuslash.org}\n * License: ${7:GPLv2}\n */" "WP Plugin Header" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/php-mode/wpheader.php" nil nil) + ("(" "( $0 " "opening-brace" electric-pair-mode nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/php-mode/opening-brace" nil nil) + ("function" "function $1($2)\n{\n $0\n}" "function" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/php-mode/function" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/php-mode/function b/emacs/.emacs.d/snippets/php-mode/function new file mode 100644 index 0000000..ab4cf2c --- /dev/null +++ b/emacs/.emacs.d/snippets/php-mode/function @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: function +# key: function +# -- +function $1($2) +{ + $0 +} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/php-mode/wpheader.php b/emacs/.emacs.d/snippets/php-mode/wpheader.php new file mode 100644 index 0000000..2c70f93 --- /dev/null +++ b/emacs/.emacs.d/snippets/php-mode/wpheader.php @@ -0,0 +1,13 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: WP Plugin Header +# key: header +# -- +/* + * Plugin Name: $1 + * Plugin URI: $2 + * Description: $3 + * Version: ${4:1.0} + * Author: ${5:Tom Willemse} + * Author URI: ${6:https://ryuslash.org} + * License: ${7:GPLv2} + */ \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/python-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..fee2e88 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/.yas-compiled-snippets.el @@ -0,0 +1,15 @@ +;;; Compiled snippets and support files for `python-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'python-mode + '(("url" "url(r'^$1', $2, name='$3')," "url" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/url" nil nil) + ("defm" "@method_decorator(permission_required('$1',\n raise_exception=True))\ndef dispatch(self, *args, **kwargs):\n '''Make sure the user has the $1 permission.'''\n return super(${3:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).dispatch(*args, **kwargs)" "Permission guard" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/permission_guard" nil nil) + ("defm" "def $1(self$2):\n '''$3'''\n $0" "method" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/method" nil nil) + ("from" "from ${1:module} import ${2:class_or_module}\n" "from ... import ..." nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/import_from" nil nil) + ("formvalid" "def form_valid(self, form):\n rv = super(`(let ((name (python-info-current-defun))) (substring name 0 (cl-position ?. name)))`, self).form_valid(form)\n $0\n return rv" "form_valid with return" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form_valid_with_return" nil nil) + ("defm" "@record_activity(model=${1:`(progn (re-search-backward \"^[ \\t]*model = \\\\([a-zA-Z_].*\\\\)$\") (match-string 1))`})\ndef form_valid(self, form):\n '''Make sure any changes to the $1 model get logged.'''\n return super(${2:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).form_valid(form)" "Record form" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form_valid" nil nil) + ("form" "class ${1:Model}Form(forms.ModelForm):\n '''Form for the $1 model.'''\n\n class Meta:\n model = $1" "Model Form" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form" nil nil) + ("defm" "def ${1:name}(self, *args, **kwargs):\n '''$2'''\n return super(${3:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).$1(*args, **kwargs)" "Empty Defmethod" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/defm_empty" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/python-mode/defm_empty b/emacs/.emacs.d/snippets/python-mode/defm_empty new file mode 100644 index 0000000..baa976e --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/defm_empty @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# name: Empty Defmethod +# key: defm +# -- +def ${1:name}(self, *args, **kwargs): + '''$2''' + return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).$1(*args, **kwargs) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/form b/emacs/.emacs.d/snippets/python-mode/form new file mode 100644 index 0000000..225d5e4 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/form @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Model Form +# key: form +# -- +class ${1:Model}Form(forms.ModelForm): + '''Form for the $1 model.''' + + class Meta: + model = $1 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/form_valid b/emacs/.emacs.d/snippets/python-mode/form_valid new file mode 100644 index 0000000..c5a7e58 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/form_valid @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Record form +# key: defm +# -- +@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`}) +def form_valid(self, form): + '''Make sure any changes to the $1 model get logged.''' + return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/form_valid_with_return b/emacs/.emacs.d/snippets/python-mode/form_valid_with_return new file mode 100644 index 0000000..fac23bc --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/form_valid_with_return @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: form_valid with return +# key: formvalid +# -- +def form_valid(self, form): + rv = super(`(let ((name (python-info-current-defun))) (substring name 0 (cl-position ?. name)))`, self).form_valid(form) + $0 + return rv \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/import_from b/emacs/.emacs.d/snippets/python-mode/import_from new file mode 100644 index 0000000..d9cc4e2 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/import_from @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# name: from ... import ... +# contributor: Tom Willemse +# key: from +# -- +from ${1:module} import ${2:class_or_module} diff --git a/emacs/.emacs.d/snippets/python-mode/method b/emacs/.emacs.d/snippets/python-mode/method new file mode 100644 index 0000000..7c033cf --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/method @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: method +# key: defm +# -- +def $1(self$2): + '''$3''' + $0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/permission_guard b/emacs/.emacs.d/snippets/python-mode/permission_guard new file mode 100644 index 0000000..ab53895 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/permission_guard @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Permission guard +# key: defm +# -- +@method_decorator(permission_required('$1', + raise_exception=True)) +def dispatch(self, *args, **kwargs): + '''Make sure the user has the $1 permission.''' + return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).dispatch(*args, **kwargs) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/url b/emacs/.emacs.d/snippets/python-mode/url new file mode 100644 index 0000000..00ade72 --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/url @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: url +# key: url +# -- +url(r'^$1', $2, name='$3'), \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/ruby-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..76a2f42 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/.yas-compiled-snippets.el @@ -0,0 +1,18 @@ +;;; Compiled snippets and support files for `ruby-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'ruby-mode + '(("reduce" "reduce { |a, e| $0 }" "reduce" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/reduce" nil nil) + ("mod" "module ${1:`(let ((fn (capitalize (file-name-nondirectory\n (directory-file-name\n default-directory)))))\n (replace-regexp-in-string \"_\" \"\" fn t t))`}\n $0\nend" "module ... end" nil + ("definitions") + nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/mod" nil nil) + ("fin" "fill_in '$1', with: $2" "fill_in" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/fill_in" nil nil) + ("factory" "FactoryGirl.define do\n factory :${1:`(file-name-sans-extension (file-name-nondirectory buffer-file-name))`} do\n $0\n end\nend" "factory" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/factory" nil nil) + ("do" "do$0\nend" "do" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/do" nil nil) + ("desc" "describe '$1' do\n $0\nend" "describe" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/describe" nil nil) + ("pseed" "Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Small', price: '20.00', width_in_cm: '25.00', height_in_cm: '21.00', width_in_mm: '250', height_in_mm: '210')\nProduct.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Medium', price: '20.00', width_in_cm: '30.00', height_in_cm: '25.80', width_in_mm: '300', height_in_mm: '258')\nProduct.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Large', price: '20.00', width_in_cm: '35.00', height_in_cm: '30.00', width_in_mm: '350', height_in_mm: '300')\nProduct.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Extra large', price: '20.00', width_in_cm: '40.00', height_in_cm: '34.00', width_in_mm: '400', height_in_mm: '340')\n" "ProductSeedWithHWGroup" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup" nil nil) + ("pseed" "Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4', width_in_cm: '$5', height_in_cm: '$6', width_in_mm: '${5:$(round (* 10 (string-to-int yas-text)))}', height_in_mm: '${6:$(round (* 10 (string-to-int yas-text)))}')" "ProductSeedWithHW" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW" nil nil) + ("pseed" "Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4')" "ProductSeed" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/ruby-mode/ProductSeed" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/ruby-mode/ProductSeed b/emacs/.emacs.d/snippets/ruby-mode/ProductSeed new file mode 100644 index 0000000..7e836c2 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/ProductSeed @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: ProductSeed +# key: pseed +# -- +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4') \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW b/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW new file mode 100644 index 0000000..843b32e --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHW @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: ProductSeedWithHW +# key: pseed +# -- +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4', width_in_cm: '$5', height_in_cm: '$6', width_in_mm: '${5:$(round (* 10 (string-to-int yas-text)))}', height_in_mm: '${6:$(round (* 10 (string-to-int yas-text)))}') \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup b/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup new file mode 100644 index 0000000..25594c5 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: ProductSeedWithHWGroup +# key: pseed +# -- +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Small', price: '20.00', width_in_cm: '25.00', height_in_cm: '21.00', width_in_mm: '250', height_in_mm: '210') +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Medium', price: '20.00', width_in_cm: '30.00', height_in_cm: '25.80', width_in_mm: '300', height_in_mm: '258') +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Large', price: '20.00', width_in_cm: '35.00', height_in_cm: '30.00', width_in_mm: '350', height_in_mm: '300') +Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Extra large', price: '20.00', width_in_cm: '40.00', height_in_cm: '34.00', width_in_mm: '400', height_in_mm: '340') diff --git a/emacs/.emacs.d/snippets/ruby-mode/describe b/emacs/.emacs.d/snippets/ruby-mode/describe new file mode 100644 index 0000000..acd3a6b --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/describe @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: describe +# key: desc +# -- +describe '$1' do + $0 +end \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/do b/emacs/.emacs.d/snippets/ruby-mode/do new file mode 100644 index 0000000..3c556fc --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/do @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: do +# key: do +# -- +do$0 +end \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/factory b/emacs/.emacs.d/snippets/ruby-mode/factory new file mode 100644 index 0000000..619b2e5 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/factory @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: factory +# key: factory +# -- +FactoryGirl.define do + factory :${1:`(file-name-sans-extension (file-name-nondirectory buffer-file-name))`} do + $0 + end +end \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/fill_in b/emacs/.emacs.d/snippets/ruby-mode/fill_in new file mode 100644 index 0000000..854b029 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/fill_in @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: fill_in +# key: fin +# -- +fill_in '$1', with: $2 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/mod b/emacs/.emacs.d/snippets/ruby-mode/mod new file mode 100644 index 0000000..9af7d23 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/mod @@ -0,0 +1,11 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: module ... end +# key: mod +# group: definitions +# -- +module ${1:`(let ((fn (capitalize (file-name-nondirectory + (directory-file-name + default-directory))))) + (replace-regexp-in-string "_" "" fn t t))`} + $0 +end \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/ruby-mode/reduce b/emacs/.emacs.d/snippets/ruby-mode/reduce new file mode 100644 index 0000000..3d4bfe4 --- /dev/null +++ b/emacs/.emacs.d/snippets/ruby-mode/reduce @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: reduce +# key: reduce +# -- +reduce { |a, e| $0 } \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/.yas-compiled-snippets.el b/emacs/.emacs.d/snippets/twig-mode/.yas-compiled-snippets.el new file mode 100644 index 0000000..43d1519 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/.yas-compiled-snippets.el @@ -0,0 +1,18 @@ +;;; Compiled snippets and support files for `twig-mode' +;;; Snippet definitions: +;;; +(yas-define-snippets 'twig-mode + '(("set" "{% set $1 = $2 %}" "set" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/set" nil nil) + ("mac" "{% macro ${1:name}(${2:args}) %}\n $0\n{% endmacro %}" "macro" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/mac" nil nil) + ("imp" "{% import \"${1:module}\" as ${1:$(if (string-match \"/\\\\\\\\([^/]*\\\\\\\\)$\" yas-text)\n (match-string 1 yas-text)\n yas-text)} %}" "import" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/imp" nil nil) + ("iif" "{% if $1 %}$0{% endif %}" "Inline if" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/iif" nil nil) + ("ife" "{% if $1 %}\n $0\n{% else %}\n\n{% endif %}" "if...else" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/ife" nil nil) + ("if" "{% if $1 %}\n $0\n{% endif %}" "if" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/if" nil nil) + ("for" "{% for $1 in $2 %}\n `yas-selected-text`$0\n{% endfor %}" "for" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/for" nil nil) + ("ext" "{% extends \"$1\" %}" "extends" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/ext" nil nil) + ("def" "{% if $1 is not defined %}\n {% set $1 = $2 %}\n{% endif %}" "default value" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/def" nil nil) + ("blk" "{% block $1 %}\n $0\n{% endblock %}" "block" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/blk" nil nil) + ("_self" "{% import _self as ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`} %}" "_self" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/twig-mode/_self" nil nil))) + + +;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016 diff --git a/emacs/.emacs.d/snippets/twig-mode/_self b/emacs/.emacs.d/snippets/twig-mode/_self new file mode 100644 index 0000000..c441690 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/_self @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: _self +# key: _self +# -- +{% import _self as ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`} %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/blk b/emacs/.emacs.d/snippets/twig-mode/blk new file mode 100644 index 0000000..bb100a3 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/blk @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: block +# key: blk +# -- +{% block $1 %} + $0 +{% endblock %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/def b/emacs/.emacs.d/snippets/twig-mode/def new file mode 100644 index 0000000..78dead4 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/def @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: default value +# key: def +# -- +{% if $1 is not defined %} + {% set $1 = $2 %} +{% endif %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/ext b/emacs/.emacs.d/snippets/twig-mode/ext new file mode 100644 index 0000000..501cae8 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/ext @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: extends +# key: ext +# -- +{% extends "$1" %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/for b/emacs/.emacs.d/snippets/twig-mode/for new file mode 100644 index 0000000..01c0cc5 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: for +# key: for +# -- +{% for $1 in $2 %} + `yas-selected-text`$0 +{% endfor %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/if b/emacs/.emacs.d/snippets/twig-mode/if new file mode 100644 index 0000000..a9385d9 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: if +# key: if +# -- +{% if $1 %} + $0 +{% endif %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/ife b/emacs/.emacs.d/snippets/twig-mode/ife new file mode 100644 index 0000000..a4d18f3 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: if...else +# key: ife +# -- +{% if $1 %} + $0 +{% else %} + +{% endif %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/iif b/emacs/.emacs.d/snippets/twig-mode/iif new file mode 100644 index 0000000..df26b61 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/iif @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Inline if +# key: iif +# -- +{% if $1 %}$0{% endif %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/imp b/emacs/.emacs.d/snippets/twig-mode/imp new file mode 100644 index 0000000..01ceb69 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/imp @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: import +# key: imp +# -- +{% import "${1:module}" as ${1:$(if (string-match "/\\\\([^/]*\\\\)$" yas-text) + (match-string 1 yas-text) + yas-text)} %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/mac b/emacs/.emacs.d/snippets/twig-mode/mac new file mode 100644 index 0000000..d4e480a --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/mac @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: macro +# key: mac +# -- +{% macro ${1:name}(${2:args}) %} + $0 +{% endmacro %} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/twig-mode/set b/emacs/.emacs.d/snippets/twig-mode/set new file mode 100644 index 0000000..715c828 --- /dev/null +++ b/emacs/.emacs.d/snippets/twig-mode/set @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: set +# key: set +# -- +{% set $1 = $2 %} \ No newline at end of file -- cgit v1.2.3-54-g00ecf