aboutsummaryrefslogtreecommitdiffstats
path: root/oni-yasnippet
diff options
context:
space:
mode:
Diffstat (limited to 'oni-yasnippet')
-rw-r--r--oni-yasnippet/Eldev13
-rw-r--r--oni-yasnippet/oni-yasnippet.el78
-rw-r--r--oni-yasnippet/snippets/bats-mode/test7
-rw-r--r--oni-yasnippet/snippets/conf-mode/section8
-rw-r--r--oni-yasnippet/snippets/csharp-mode/testm9
-rw-r--r--oni-yasnippet/snippets/css-mode/box-shadow5
-rw-r--r--oni-yasnippet/snippets/emacs-lisp-mode/cookie5
-rw-r--r--oni-yasnippet/snippets/emacs-lisp-mode/depends-on5
-rw-r--r--oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git5
-rw-r--r--oni-yasnippet/snippets/emacs-lisp-mode/face5
-rw-r--r--oni-yasnippet/snippets/haml-mode/faq12
-rw-r--r--oni-yasnippet/snippets/html-mode/block7
-rw-r--r--oni-yasnippet/snippets/html-mode/for8
-rw-r--r--oni-yasnippet/snippets/html-mode/generic-block8
-rw-r--r--oni-yasnippet/snippets/html-mode/script5
-rw-r--r--oni-yasnippet/snippets/html-mode/trans-with-cap6
-rw-r--r--oni-yasnippet/snippets/nxml-mode/Import6
-rw-r--r--oni-yasnippet/snippets/nxml-mode/pencil-property7
-rw-r--r--oni-yasnippet/snippets/nxml-mode/pencil-property-value5
-rw-r--r--oni-yasnippet/snippets/nxml-mode/pencil-shortcut9
-rw-r--r--oni-yasnippet/snippets/org-mode/codeblock7
-rw-r--r--oni-yasnippet/snippets/org-mode/heading9
-rw-r--r--oni-yasnippet/snippets/org-mode/project51
-rw-r--r--oni-yasnippet/snippets/org-mode/snippet14
-rw-r--r--oni-yasnippet/snippets/org-mode/task10
-rw-r--r--oni-yasnippet/snippets/php-mode/arrow-function6
-rw-r--r--oni-yasnippet/snippets/php-mode/casts7
-rw-r--r--oni-yasnippet/snippets/php-mode/class8
-rw-r--r--oni-yasnippet/snippets/php-mode/constructor8
-rw-r--r--oni-yasnippet/snippets/php-mode/factory6
-rw-r--r--oni-yasnippet/snippets/php-mode/for7
-rw-r--r--oni-yasnippet/snippets/php-mode/function-expression8
-rw-r--r--oni-yasnippet/snippets/php-mode/function-statement11
-rw-r--r--oni-yasnippet/snippets/php-mode/if-statement7
-rw-r--r--oni-yasnippet/snippets/php-mode/logger-debug5
-rw-r--r--oni-yasnippet/snippets/php-mode/logger-error5
-rw-r--r--oni-yasnippet/snippets/php-mode/logger-info5
-rw-r--r--oni-yasnippet/snippets/php-mode/logger-warning5
-rw-r--r--oni-yasnippet/snippets/php-mode/mark-test-skipped6
-rw-r--r--oni-yasnippet/snippets/php-mode/namespace5
-rw-r--r--oni-yasnippet/snippets/php-mode/php5
-rw-r--r--oni-yasnippet/snippets/php-mode/phpstan-ignore5
-rw-r--r--oni-yasnippet/snippets/php-mode/strict-types5
-rw-r--r--oni-yasnippet/snippets/php-mode/test-class14
-rw-r--r--oni-yasnippet/snippets/php-mode/test-comment9
-rw-r--r--oni-yasnippet/snippets/php-mode/test-name8
-rw-r--r--oni-yasnippet/snippets/php-mode/todo-comment5
-rw-r--r--oni-yasnippet/snippets/php-mode/var5
-rw-r--r--oni-yasnippet/snippets/php-mode/wpheader.php13
-rw-r--r--oni-yasnippet/snippets/php-ts-mode/.yas-parents1
-rw-r--r--oni-yasnippet/snippets/python-mode/defm_empty7
-rw-r--r--oni-yasnippet/snippets/python-mode/form9
-rw-r--r--oni-yasnippet/snippets/python-mode/form_valid8
-rw-r--r--oni-yasnippet/snippets/python-mode/form_valid_with_return8
-rw-r--r--oni-yasnippet/snippets/python-mode/import_from6
-rw-r--r--oni-yasnippet/snippets/python-mode/method7
-rw-r--r--oni-yasnippet/snippets/python-mode/permission_guard9
-rw-r--r--oni-yasnippet/snippets/python-mode/url5
-rw-r--r--oni-yasnippet/snippets/ruby-mode/ProductSeed5
-rw-r--r--oni-yasnippet/snippets/ruby-mode/ProductSeedHW5
-rw-r--r--oni-yasnippet/snippets/ruby-mode/ProductSeedHWGroup8
-rw-r--r--oni-yasnippet/snippets/ruby-mode/describe7
-rw-r--r--oni-yasnippet/snippets/ruby-mode/do6
-rw-r--r--oni-yasnippet/snippets/ruby-mode/factory9
-rw-r--r--oni-yasnippet/snippets/ruby-mode/fill_in5
-rw-r--r--oni-yasnippet/snippets/ruby-mode/mod11
-rw-r--r--oni-yasnippet/snippets/ruby-mode/reduce5
-rw-r--r--oni-yasnippet/snippets/twig-mode/_self5
-rw-r--r--oni-yasnippet/snippets/twig-mode/blk7
-rw-r--r--oni-yasnippet/snippets/twig-mode/def7
-rw-r--r--oni-yasnippet/snippets/twig-mode/ext5
-rw-r--r--oni-yasnippet/snippets/twig-mode/for7
-rw-r--r--oni-yasnippet/snippets/twig-mode/if7
-rw-r--r--oni-yasnippet/snippets/twig-mode/ife9
-rw-r--r--oni-yasnippet/snippets/twig-mode/iif5
-rw-r--r--oni-yasnippet/snippets/twig-mode/imp7
-rw-r--r--oni-yasnippet/snippets/twig-mode/mac7
-rw-r--r--oni-yasnippet/snippets/twig-mode/set5
78 files changed, 664 insertions, 0 deletions
diff --git a/oni-yasnippet/Eldev b/oni-yasnippet/Eldev
new file mode 100644
index 0000000..b6bdf4c
--- /dev/null
+++ b/oni-yasnippet/Eldev
@@ -0,0 +1,13 @@
+; -*- mode: emacs-lisp; lexical-binding: t -*-
+
+;; Uncomment some calls below as needed for your project.
+(eldev-use-package-archive 'gnu-elpa)
+;(eldev-use-package-archive 'nongnu-elpa)
+(eldev-use-package-archive 'melpa)
+(eldev-use-package-archive `("oni" . ,(expand-file-name "../public/packages")))
+
+(eldev-use-plugin 'autoloads)
+
+(setf eldev-files-to-package
+ `(:or ,eldev-files-to-package
+ '("*.el" "snippets/**/*")))
diff --git a/oni-yasnippet/oni-yasnippet.el b/oni-yasnippet/oni-yasnippet.el
new file mode 100644
index 0000000..11e96f7
--- /dev/null
+++ b/oni-yasnippet/oni-yasnippet.el
@@ -0,0 +1,78 @@
+;;; oni-yasnippet.el --- Yasnippet configuration -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019 Tom Willemse
+
+;; Author: Tom Willemse <tom@ryuslash.org>
+;; Keywords: local
+;; Version: 2026.0528.021141
+;; Package-Requires: (yasnippet yasnippet-snippets diminish)
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Yasnippet configuration. To use this configuratin you should put the
+;; following two lines in your init file:
+;;
+;; (with-eval-after-load 'yasnippet (require 'oni-yasnippet))
+;; (yas-global-mode)
+
+
+;;; Code:
+
+(require 'yasnippet)
+(require 'diminish)
+
+(defconst oni-yasnippet-root
+ (file-name-directory
+ (or load-file-name
+ (buffer-file-name)))
+ "The directory where ‘oni-yasnippet’ was loaded from.")
+
+(defconst oni-yasnippet-snippets-dir
+ (expand-file-name "snippets" oni-yasnippet-root))
+
+(defun oni-yasnippet-snippets-initialize ()
+ "Initialize the snippets for ‘oni-yasnippet’."
+ (when (boundp 'yas-snippet-dirs)
+ (add-to-list 'yas-snippet-dirs oni-yasnippet-snippets-dir t)))
+
+(defun oni-yasnippet-remove-snippet-by-name (name mode)
+ "Remove the snippet NAME from MODE's snippet tables."
+ (and-let* ((mode-table (gethash mode yas--tables))
+ (uuidhash-table (yas--table-uuidhash mode-table))
+ (hash-table (yas--table-hash mode-table))
+ (snippet (gethash name uuidhash-table))
+ (key (yas--template-key snippet)))
+ (remhash key hash-table)
+ (remhash name uuidhash-table)))
+
+(defun oni-yasnippet-cleanup-snippets ()
+ "Remove some snippets that I don't like."
+ (oni-yasnippet-remove-snippet-by-name "defun" 'lisp-interaction-mode))
+
+(with-eval-after-load 'yasnippet (diminish 'yas-minor-mode))
+
+(setq-default yas-buffer-local-condition yas-not-string-or-comment-condition)
+
+(define-key yas-minor-mode-map (kbd "<tab>") nil)
+(define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand)
+(define-key yas-minor-mode-map (kbd "SPC") yas-maybe-expand)
+(define-key yas-minor-mode-map (kbd "TAB") nil)
+
+(add-hook 'yas-minor-mode-hook #'oni-yasnippet-snippets-initialize)
+(add-hook 'yas-after-reload-hook #'oni-yasnippet-cleanup-snippets)
+
+(provide 'oni-yasnippet)
+;;; oni-yasnippet.el ends here
diff --git a/oni-yasnippet/snippets/bats-mode/test b/oni-yasnippet/snippets/bats-mode/test
new file mode 100644
index 0000000..8a2f028
--- /dev/null
+++ b/oni-yasnippet/snippets/bats-mode/test
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: test
+# key: test
+# --
+@test "$1" {
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/conf-mode/section b/oni-yasnippet/snippets/conf-mode/section
new file mode 100644
index 0000000..496e4fd
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/csharp-mode/testm b/oni-yasnippet/snippets/csharp-mode/testm
new file mode 100644
index 0000000..4bd243d
--- /dev/null
+++ b/oni-yasnippet/snippets/csharp-mode/testm
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: Test Method
+# key: testm
+# --
+[TestMethod]
+public void ${1:TestMethod}()
+{
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/css-mode/box-shadow b/oni-yasnippet/snippets/css-mode/box-shadow
new file mode 100644
index 0000000..82fe9d5
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/emacs-lisp-mode/cookie b/oni-yasnippet/snippets/emacs-lisp-mode/cookie
new file mode 100644
index 0000000..6fafd3c
--- /dev/null
+++ b/oni-yasnippet/snippets/emacs-lisp-mode/cookie
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: with-eval-after-load-cookie
+# key: cookie
+# --
+;;;###autoload(with-eval-after-load '${1:`(string-remove-prefix "oni-" (string-remove-suffix ".el" (buffer-name)))`-mode} (require '`(string-remove-suffix ".el" (buffer-name))`)) \ No newline at end of file
diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/depends-on b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on
new file mode 100644
index 0000000..4f99d92
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git
new file mode 100644
index 0000000..1da2f31
--- /dev/null
+++ b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: depends-on-git
+# key: do
+# --
+(depends-on "$1" :git "../" :files ("$1.el"))$0 \ No newline at end of file
diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/face b/oni-yasnippet/snippets/emacs-lisp-mode/face
new file mode 100644
index 0000000..9fdbbb2
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/haml-mode/faq b/oni-yasnippet/snippets/haml-mode/faq
new file mode 100644
index 0000000..4d1a9e2
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/html-mode/block b/oni-yasnippet/snippets/html-mode/block
new file mode 100644
index 0000000..6510011
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/html-mode/for b/oni-yasnippet/snippets/html-mode/for
new file mode 100644
index 0000000..01d9c44
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/html-mode/generic-block b/oni-yasnippet/snippets/html-mode/generic-block
new file mode 100644
index 0000000..82d40c7
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/html-mode/script b/oni-yasnippet/snippets/html-mode/script
new file mode 100644
index 0000000..e50dbf5
--- /dev/null
+++ b/oni-yasnippet/snippets/html-mode/script
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: script
+# key: script
+# --
+<script src="$1" type="${2:text/javascript}" language="${3:javascript}"></script> \ No newline at end of file
diff --git a/oni-yasnippet/snippets/html-mode/trans-with-cap b/oni-yasnippet/snippets/html-mode/trans-with-cap
new file mode 100644
index 0000000..4f20a33
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/nxml-mode/Import b/oni-yasnippet/snippets/nxml-mode/Import
new file mode 100644
index 0000000..bddbf3f
--- /dev/null
+++ b/oni-yasnippet/snippets/nxml-mode/Import
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: Import
+# key: imp
+# condition: (string-suffix-p ".proj" (buffer-file-name))
+# --
+<Import Project="$1"/>
diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-property b/oni-yasnippet/snippets/nxml-mode/pencil-property
new file mode 100644
index 0000000..7fafcb8
--- /dev/null
+++ b/oni-yasnippet/snippets/nxml-mode/pencil-property
@@ -0,0 +1,7 @@
+# -*- mode: snippet; require-final-newline: nil -*-
+# name: PencilProperty
+# key: p
+# --
+<Property name="$1"
+ displayName="$2"
+ type="$3">$4</Property> \ No newline at end of file
diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-property-value b/oni-yasnippet/snippets/nxml-mode/pencil-property-value
new file mode 100644
index 0000000..5da3d10
--- /dev/null
+++ b/oni-yasnippet/snippets/nxml-mode/pencil-property-value
@@ -0,0 +1,5 @@
+# -*- mode: snippet; require-final-newline: nil -*-
+# name: PropertyValue
+# key: pv
+# --
+<PropertyValue name="$1">$2</PropertyValue> \ No newline at end of file
diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-shortcut b/oni-yasnippet/snippets/nxml-mode/pencil-shortcut
new file mode 100644
index 0000000..e760d27
--- /dev/null
+++ b/oni-yasnippet/snippets/nxml-mode/pencil-shortcut
@@ -0,0 +1,9 @@
+# -*- mode: snippet; require-final-newline: nil -*-
+# name: Shortcut
+# key: s
+# --
+<Shortcut displayName="$1"
+ icon="$2"
+ to="$3">
+ $0
+</Shortcut> \ No newline at end of file
diff --git a/oni-yasnippet/snippets/org-mode/codeblock b/oni-yasnippet/snippets/org-mode/codeblock
new file mode 100644
index 0000000..a200b08
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/org-mode/heading b/oni-yasnippet/snippets/org-mode/heading
new file mode 100644
index 0000000..a472f06
--- /dev/null
+++ b/oni-yasnippet/snippets/org-mode/heading
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: Heading
+# key: <t
+# --
+${1:*} ${2:TODO$(upcase yas-text)} $3
+:PROPERTIES:
+:CREATED: [`(format-time-string "%Y-%m-%d %a %H:%M")`]
+:END:
+$0 \ No newline at end of file
diff --git a/oni-yasnippet/snippets/org-mode/project b/oni-yasnippet/snippets/org-mode/project
new file mode 100644
index 0000000..269d655
--- /dev/null
+++ b/oni-yasnippet/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
+ <script src="/keyjs.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ keyjs_initialize({ "u": [ "keyjs_goto", "../index.html" ],
+ "h": [ "keyjs_goto", "http://ryuslash.org" ] });
+ </script>
+#+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/oni-yasnippet/snippets/org-mode/snippet b/oni-yasnippet/snippets/org-mode/snippet
new file mode 100644
index 0000000..67f15d5
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/org-mode/task b/oni-yasnippet/snippets/org-mode/task
new file mode 100644
index 0000000..af229d1
--- /dev/null
+++ b/oni-yasnippet/snippets/org-mode/task
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: task
+# key: todo
+# --
+* TODO ${1:What is the outcome?}
+:PROPERTIES:
+:CREATED: [`(format-time-string "%Y-%m-%d %a %H:%M")`]
+:END:
+
+$0
diff --git a/oni-yasnippet/snippets/php-mode/arrow-function b/oni-yasnippet/snippets/php-mode/arrow-function
new file mode 100644
index 0000000..3b44e01
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/arrow-function
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: arrow-function
+# key: f
+# condition: (oni-php-in-expression-context-p)
+# --
+fn($1): $2 => $3 \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/casts b/oni-yasnippet/snippets/php-mode/casts
new file mode 100644
index 0000000..2850d72
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/casts
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: casts
+# key: casts
+# --
+protected $casts = [
+ '$1' => $0,
+]; \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/class b/oni-yasnippet/snippets/php-mode/class
new file mode 100644
index 0000000..26a58a1
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/class
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: class
+# key: cls
+# --
+class ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`}
+{
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/constructor b/oni-yasnippet/snippets/php-mode/constructor
new file mode 100644
index 0000000..f919e6c
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/constructor
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: constructor
+# key: constructor
+# --
+public function __construct($1)
+{
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/factory b/oni-yasnippet/snippets/php-mode/factory
new file mode 100644
index 0000000..534f227
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/factory
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: factory
+# key: f
+# condition: (and (oni-php-in-test-file) (oni-php-in-static-call-context-p))
+# --
+factory()->create([$0]); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/for b/oni-yasnippet/snippets/php-mode/for
new file mode 100644
index 0000000..1adae91
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/for
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: for
+# key: for
+# --
+for (${1:$i = 0}; ${2:$i < $3}; ${4:$i++}) {
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/function-expression b/oni-yasnippet/snippets/php-mode/function-expression
new file mode 100644
index 0000000..fa59b03
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/function-expression
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: function expression
+# key: f
+# condition: (oni-php-in-expression-context-p)
+# --
+function ($1) ${2:use ($3)} {
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/function-statement b/oni-yasnippet/snippets/php-mode/function-statement
new file mode 100644
index 0000000..9c44aef
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/function-statement
@@ -0,0 +1,11 @@
+# -*- mode: snippet -*-
+# name: function statement
+# key: f
+# condition: (oni-php-in-expression-context-p)
+# --
+/**
+ * $5
+ */
+${1:private} function $2($3): ${4:void} {
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/if-statement b/oni-yasnippet/snippets/php-mode/if-statement
new file mode 100644
index 0000000..6033e3a
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/if-statement
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: if statement
+# key: ?
+# --
+if ($1) {
+ $2
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/logger-debug b/oni-yasnippet/snippets/php-mode/logger-debug
new file mode 100644
index 0000000..d0e0b7e
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/logger-debug
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: logger.debug
+# key: ld
+# --
+logger()->debug('$1'${2:, [ $3 ]}); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/logger-error b/oni-yasnippet/snippets/php-mode/logger-error
new file mode 100644
index 0000000..19344aa
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/logger-error
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: logger-error
+# key: le
+# --
+logger()->error('$1'${2:, [ $3 ]}); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/logger-info b/oni-yasnippet/snippets/php-mode/logger-info
new file mode 100644
index 0000000..9491d24
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/logger-info
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: logger.info
+# key: li
+# --
+logger()->info('$1'${2:, [ $3 ]}); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/logger-warning b/oni-yasnippet/snippets/php-mode/logger-warning
new file mode 100644
index 0000000..3945490
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/logger-warning
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: logger.warning
+# key: lw
+# --
+logger()->warning('$1'${2, [ $3 ]}); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/mark-test-skipped b/oni-yasnippet/snippets/php-mode/mark-test-skipped
new file mode 100644
index 0000000..ce4761d
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/mark-test-skipped
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: mark test skipped
+# key: @s
+# condition: (string-suffix-p "Test.php" buffer-file-name)
+# --
+$this->markTestSkipped("${1:Don't skip your tests.}"); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/namespace b/oni-yasnippet/snippets/php-mode/namespace
new file mode 100644
index 0000000..7a5b5e1
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/namespace
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: namespace
+# key: ns
+# --
+namespace ${1:`(oni-php-generate-namespace)`}; \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/php b/oni-yasnippet/snippets/php-mode/php
new file mode 100644
index 0000000..12f7492
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/php
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: <?php
+# key: php
+# --
+<?php
diff --git a/oni-yasnippet/snippets/php-mode/phpstan-ignore b/oni-yasnippet/snippets/php-mode/phpstan-ignore
new file mode 100644
index 0000000..91439ba
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/phpstan-ignore
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: phpstan-ignore
+# key: @i
+# --
+/** @phpstan-ignore $1 */ \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/strict-types b/oni-yasnippet/snippets/php-mode/strict-types
new file mode 100644
index 0000000..bdcf3f9
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/strict-types
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: strict-types
+# key: strict-types
+# --
+declare(strict_types=1); \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/test-class b/oni-yasnippet/snippets/php-mode/test-class
new file mode 100644
index 0000000..de3bd3f
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/test-class
@@ -0,0 +1,14 @@
+# -*- mode: snippet -*-
+# name: test-class
+# key: test
+# --
+
+use Illuminate\Foundation\Testing\RefreshDatabase;
+use Tests\TestCase;
+
+class ${1:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`} extends TestCase
+{
+ use RefreshDatabase;
+
+ $0
+} \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/test-comment b/oni-yasnippet/snippets/php-mode/test-comment
new file mode 100644
index 0000000..b1c9dfb
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/test-comment
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: test-comment
+# key: @t
+# --
+#[Test]
+public function $1(): void
+{
+ $0
+}
diff --git a/oni-yasnippet/snippets/php-mode/test-name b/oni-yasnippet/snippets/php-mode/test-name
new file mode 100644
index 0000000..2b9d72b
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/test-name
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: test-name
+# key: test
+# --
+public function test_$1(): void
+{
+ $0
+}
diff --git a/oni-yasnippet/snippets/php-mode/todo-comment b/oni-yasnippet/snippets/php-mode/todo-comment
new file mode 100644
index 0000000..a079ce8
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/todo-comment
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: todo-comment
+# key: /t
+# --
+`comment-start``(if (looking-back " " 2) " " "")`TODO: $0`comment-end` \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/var b/oni-yasnippet/snippets/php-mode/var
new file mode 100644
index 0000000..ce2b8fc
--- /dev/null
+++ b/oni-yasnippet/snippets/php-mode/var
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: var
+# key: @v
+# --
+/** @var $1 `(save-excursion (and (search-forward "$" nil t) (symbol-at-point)))` */`(unless (looking-at (rx "\n")) "\n")` \ No newline at end of file
diff --git a/oni-yasnippet/snippets/php-mode/wpheader.php b/oni-yasnippet/snippets/php-mode/wpheader.php
new file mode 100644
index 0000000..2c70f93
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/php-ts-mode/.yas-parents b/oni-yasnippet/snippets/php-ts-mode/.yas-parents
new file mode 100644
index 0000000..00d75e1
--- /dev/null
+++ b/oni-yasnippet/snippets/php-ts-mode/.yas-parents
@@ -0,0 +1 @@
+php-mode \ No newline at end of file
diff --git a/oni-yasnippet/snippets/python-mode/defm_empty b/oni-yasnippet/snippets/python-mode/defm_empty
new file mode 100644
index 0000000..baa976e
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/form b/oni-yasnippet/snippets/python-mode/form
new file mode 100644
index 0000000..225d5e4
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/form_valid b/oni-yasnippet/snippets/python-mode/form_valid
new file mode 100644
index 0000000..c5a7e58
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/form_valid_with_return b/oni-yasnippet/snippets/python-mode/form_valid_with_return
new file mode 100644
index 0000000..fac23bc
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/import_from b/oni-yasnippet/snippets/python-mode/import_from
new file mode 100644
index 0000000..d9cc4e2
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/method b/oni-yasnippet/snippets/python-mode/method
new file mode 100644
index 0000000..7c033cf
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/permission_guard b/oni-yasnippet/snippets/python-mode/permission_guard
new file mode 100644
index 0000000..ab53895
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/python-mode/url b/oni-yasnippet/snippets/python-mode/url
new file mode 100644
index 0000000..00ade72
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/ProductSeed b/oni-yasnippet/snippets/ruby-mode/ProductSeed
new file mode 100644
index 0000000..7e836c2
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/ProductSeedHW b/oni-yasnippet/snippets/ruby-mode/ProductSeedHW
new file mode 100644
index 0000000..843b32e
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/ProductSeedHWGroup b/oni-yasnippet/snippets/ruby-mode/ProductSeedHWGroup
new file mode 100644
index 0000000..25594c5
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/describe b/oni-yasnippet/snippets/ruby-mode/describe
new file mode 100644
index 0000000..acd3a6b
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/do b/oni-yasnippet/snippets/ruby-mode/do
new file mode 100644
index 0000000..3c556fc
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/factory b/oni-yasnippet/snippets/ruby-mode/factory
new file mode 100644
index 0000000..619b2e5
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/fill_in b/oni-yasnippet/snippets/ruby-mode/fill_in
new file mode 100644
index 0000000..854b029
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/mod b/oni-yasnippet/snippets/ruby-mode/mod
new file mode 100644
index 0000000..9af7d23
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/ruby-mode/reduce b/oni-yasnippet/snippets/ruby-mode/reduce
new file mode 100644
index 0000000..3d4bfe4
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/_self b/oni-yasnippet/snippets/twig-mode/_self
new file mode 100644
index 0000000..c441690
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/blk b/oni-yasnippet/snippets/twig-mode/blk
new file mode 100644
index 0000000..bb100a3
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/def b/oni-yasnippet/snippets/twig-mode/def
new file mode 100644
index 0000000..78dead4
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/ext b/oni-yasnippet/snippets/twig-mode/ext
new file mode 100644
index 0000000..501cae8
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/for b/oni-yasnippet/snippets/twig-mode/for
new file mode 100644
index 0000000..01c0cc5
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/if b/oni-yasnippet/snippets/twig-mode/if
new file mode 100644
index 0000000..a9385d9
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/ife b/oni-yasnippet/snippets/twig-mode/ife
new file mode 100644
index 0000000..a4d18f3
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/iif b/oni-yasnippet/snippets/twig-mode/iif
new file mode 100644
index 0000000..df26b61
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/imp b/oni-yasnippet/snippets/twig-mode/imp
new file mode 100644
index 0000000..01ceb69
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/mac b/oni-yasnippet/snippets/twig-mode/mac
new file mode 100644
index 0000000..d4e480a
--- /dev/null
+++ b/oni-yasnippet/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/oni-yasnippet/snippets/twig-mode/set b/oni-yasnippet/snippets/twig-mode/set
new file mode 100644
index 0000000..715c828
--- /dev/null
+++ b/oni-yasnippet/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