[ruby][vim] 用正则替换旧的 hash rocket 语法

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

你可能感兴趣的:(hash,Ruby,Rocket)