Last active
August 29, 2023 05:15
-
-
Save bsnape/edff869d5b7dc0b0d7c2 to your computer and use it in GitHub Desktop.
Rubymine find & replace string hash rockets with new syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find: | |
\'(\w+)\'\s*=> | |
replace: | |
$1: | |
replace symbol hash rockets with new syntax | |
find: | |
:(\w+)\s*=> | |
replace: | |
$1: |
I found this https://www.jorgemanrubia.com/2012/12/29/why-i-love-rubymine/
That says "If you place the cursor inside a hash entry and press ALT-ENTER you are offered the possibility of converting between => and : notations. Do the same inside a block, and you can convert automatically between the braces or do/end syntax. Do it inside a string to convert it to a symbol"
For double-quote users, use this for the find of string hash keys:
\"(\w+)\"\s*=>
From symbol keys to double quote rocket keys
find:
(\w+):
replace:
"$1" =>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do you use this in rubymine? I'm looking for a solution to this problem! thanks