标签:
Change this way
:param => ‘value‘
for this way
param: ‘value‘
open .rb file in vim and do
%s/:\([^=,‘"]*\) =>/\1:/g
if you want use the interactive mode, add c in the end of command
%s/:\([^=,‘"]*\) =>/\1:/gc
case you want the inverse, try
:%s/\(\w*\): \([‘:]\)/:\1 => \2/gc
[ruby][vim] 用正则替换旧的 hash rocket 语法
标签:
原文地址:http://my.oschina.net/xieyunzi/blog/378206