aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2016-07-04 18:16:17 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2016-07-04 18:16:17 +0900
commit759ac67b41d9cb7185b40cd84773fce5caa5b3eb (patch)
tree535ead2c6a4bc174f80f52be8d3314b6fbeb9920
parent4237a9c39c5c6debe1e52c4c40186406838bc123 (diff)
downloadvim-sonictemplate-759ac67b41d9cb7185b40cd84773fce5caa5b3eb.tar.gz
vim-sonictemplate-759ac67b41d9cb7185b40cd84773fce5caa5b3eb.tar.bz2
vim-sonictemplate-759ac67b41d9cb7185b40cd84773fce5caa5b3eb.zip
add postfix template for ruby
-rw-r--r--template/ruby/pattern.stpl31
1 files changed, 31 insertions, 0 deletions
diff --git a/template/ruby/pattern.stpl b/template/ruby/pattern.stpl
new file mode 100644
index 0000000..cc02af5
--- /dev/null
+++ b/template/ruby/pattern.stpl
@@ -0,0 +1,31 @@
+^\s*\zs\(\S.*\)\.each$
+ {{$1}}.each do |x|
+ {{_cursor_}}
+ end
+
+^\s*\zs\(\S.*\)\.eachb$
+ {{$1}}.each {|x|
+ {{_cursor_}}
+ }
+
+^\s*\zs\(\S.*\)\.eachi$
+ {{$1}}.each_with_index do |x,i|
+ {{_cursor_}}
+ end
+
+^\s*\zs\(\S.*\)\.eachbi$
+ {{$1}}.each_with_index {|x,i|
+ {{_cursor_}}
+ }
+
+^\s*\zs\(\S.*\)\.map$
+ {{$1}}.map do |x|
+ {{_cursor_}}
+ end
+
+^\s*\zs\(\S.*\)\.mapb$
+ {{$1}}.map {|x|
+ {{_cursor_}}
+ }
+
+