aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2017-03-05 23:08:19 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2017-03-05 23:08:19 +0900
commit95c88f7ae86c6ce95192845d7ba4564ae46f28e9 (patch)
tree28a46b49d1cb1534702a0a32533a2304359df86e /template
parentecc8b4104e4dee029d0aa306bb476557680c0993 (diff)
downloadvim-sonictemplate-95c88f7ae86c6ce95192845d7ba4564ae46f28e9.tar.gz
vim-sonictemplate-95c88f7ae86c6ce95192845d7ba4564ae46f28e9.tar.bz2
vim-sonictemplate-95c88f7ae86c6ce95192845d7ba4564ae46f28e9.zip
add some staff for es6
Diffstat (limited to 'template')
-rw-r--r--template/javascript/base-es6-class.js6
-rw-r--r--template/javascript/snip-es6-getter.js5
-rw-r--r--template/javascript/snip-es6-setter.js5
3 files changed, 16 insertions, 0 deletions
diff --git a/template/javascript/base-es6-class.js b/template/javascript/base-es6-class.js
new file mode 100644
index 0000000..7f41cb6
--- /dev/null
+++ b/template/javascript/base-es6-class.js
@@ -0,0 +1,6 @@
+class {{_expr_:substitute('{{_name_}}', '\w\+', '\u\0', '')}} {
+ constructor() {
+ {{_cursor_}}
+ }
+}
+{{_filter_:es6}}
diff --git a/template/javascript/snip-es6-getter.js b/template/javascript/snip-es6-getter.js
new file mode 100644
index 0000000..90f87a0
--- /dev/null
+++ b/template/javascript/snip-es6-getter.js
@@ -0,0 +1,5 @@
+{{_define_:var:"new".substitute('{{_name_}}', '\w\+', '\u\0', '')}}
+get {{_input_:name}}() {
+ return this._{{_var_:name}};
+}
+{{_cursor_}}
diff --git a/template/javascript/snip-es6-setter.js b/template/javascript/snip-es6-setter.js
new file mode 100644
index 0000000..b5aa36f
--- /dev/null
+++ b/template/javascript/snip-es6-setter.js
@@ -0,0 +1,5 @@
+{{_define_:var:"new".substitute('{{_name_}}', '\w\+', '\u\0', '')}}
+set {{_input_:name}}({{_var_:var}}) {
+ this._{{_var_:name}} = {{_var_:var}};
+}
+{{_cursor_}}