From 7be825cc9e6554a6a7a8e1cd8f709e94e7e8901b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 20 Aug 2014 23:51:42 +0200 Subject: Add some snippets --- .emacs.d/snippets/conf-mode/section | 8 ++++++++ .emacs.d/snippets/emacs-lisp/face | 5 +++++ .emacs.d/snippets/html-mode/block | 7 +++++++ .emacs.d/snippets/php-mode/function | 8 ++++++++ .emacs.d/snippets/php-mode/wpheader.php | 13 +++++++++++++ .emacs.d/snippets/python-mode/form_valid_with_return | 8 ++++++++ .emacs.d/snippets/python-mode/method | 7 +++++++ .emacs.d/snippets/ruby-mode/ProductSeed | 5 +++++ .emacs.d/snippets/ruby-mode/ProductSeedHW | 5 +++++ .emacs.d/snippets/ruby-mode/ProductSeedHWGroup | 8 ++++++++ 10 files changed, 74 insertions(+) create mode 100644 .emacs.d/snippets/conf-mode/section create mode 100644 .emacs.d/snippets/emacs-lisp/face create mode 100644 .emacs.d/snippets/html-mode/block create mode 100644 .emacs.d/snippets/php-mode/function create mode 100644 .emacs.d/snippets/php-mode/wpheader.php create mode 100644 .emacs.d/snippets/python-mode/form_valid_with_return create mode 100644 .emacs.d/snippets/python-mode/method create mode 100644 .emacs.d/snippets/ruby-mode/ProductSeed create mode 100644 .emacs.d/snippets/ruby-mode/ProductSeedHW create mode 100644 .emacs.d/snippets/ruby-mode/ProductSeedHWGroup diff --git a/.emacs.d/snippets/conf-mode/section b/.emacs.d/snippets/conf-mode/section new file mode 100644 index 0000000..55be8f8 --- /dev/null +++ b/.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.d/snippets/emacs-lisp/face b/.emacs.d/snippets/emacs-lisp/face new file mode 100644 index 0000000..0a13b99 --- /dev/null +++ b/.emacs.d/snippets/emacs-lisp/face @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: face +# key: f +# -- + `($1 ((t (${2::foreground} $0)))) \ No newline at end of file diff --git a/.emacs.d/snippets/html-mode/block b/.emacs.d/snippets/html-mode/block new file mode 100644 index 0000000..6510011 --- /dev/null +++ b/.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.d/snippets/php-mode/function b/.emacs.d/snippets/php-mode/function new file mode 100644 index 0000000..ab4cf2c --- /dev/null +++ b/.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.d/snippets/php-mode/wpheader.php b/.emacs.d/snippets/php-mode/wpheader.php new file mode 100644 index 0000000..2c70f93 --- /dev/null +++ b/.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.d/snippets/python-mode/form_valid_with_return b/.emacs.d/snippets/python-mode/form_valid_with_return new file mode 100644 index 0000000..fac23bc --- /dev/null +++ b/.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.d/snippets/python-mode/method b/.emacs.d/snippets/python-mode/method new file mode 100644 index 0000000..7c033cf --- /dev/null +++ b/.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.d/snippets/ruby-mode/ProductSeed b/.emacs.d/snippets/ruby-mode/ProductSeed new file mode 100644 index 0000000..7e836c2 --- /dev/null +++ b/.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.d/snippets/ruby-mode/ProductSeedHW b/.emacs.d/snippets/ruby-mode/ProductSeedHW new file mode 100644 index 0000000..843b32e --- /dev/null +++ b/.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.d/snippets/ruby-mode/ProductSeedHWGroup b/.emacs.d/snippets/ruby-mode/ProductSeedHWGroup new file mode 100644 index 0000000..25594c5 --- /dev/null +++ b/.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') -- cgit v1.2.3-54-g00ecf