summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-08-20 23:51:42 +0200
committerGravatar Tom Willemse2014-08-20 23:51:42 +0200
commit7be825cc9e6554a6a7a8e1cd8f709e94e7e8901b (patch)
tree6a2878ef60d3715da78215c3038a68afce41e528
parentac1a7d8e8994f83dd829159be36334207a02d00c (diff)
downloademacs-7be825cc9e6554a6a7a8e1cd8f709e94e7e8901b.tar.gz
emacs-7be825cc9e6554a6a7a8e1cd8f709e94e7e8901b.zip
Add some snippetsHEADmaster
-rw-r--r--.emacs.d/snippets/conf-mode/section8
-rw-r--r--.emacs.d/snippets/emacs-lisp/face5
-rw-r--r--.emacs.d/snippets/html-mode/block7
-rw-r--r--.emacs.d/snippets/php-mode/function8
-rw-r--r--.emacs.d/snippets/php-mode/wpheader.php13
-rw-r--r--.emacs.d/snippets/python-mode/form_valid_with_return8
-rw-r--r--.emacs.d/snippets/python-mode/method7
-rw-r--r--.emacs.d/snippets/ruby-mode/ProductSeed5
-rw-r--r--.emacs.d/snippets/ruby-mode/ProductSeedHW5
-rw-r--r--.emacs.d/snippets/ruby-mode/ProductSeedHWGroup8
10 files changed, 74 insertions, 0 deletions
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')