7

Is there a keyboard shortcut to toggle between single quotes and double quotes in a Ruby code? Or a key I can set up to accept the Inspection Hint?

Thanks, M.

Martin Cleaver
  • 909
  • 8
  • 21

3 Answers3

9

To accept any inspection hint in RubyMine, press Alt+Enter and then use the arrow keys and Enter to select the quickfix to apply.

jesterjunk
  • 2,342
  • 22
  • 18
yole
  • 92,896
  • 20
  • 260
  • 197
9

Current as of RubyMine 2016.2, there is an easier way to convert all quotes via the keyboard:

  • select part of string whose quotation type you want to change
  • Alt + Enter to accept inspection hint
  • Arrow right
  • "Fix all 'Double quoted string' problems in file"

Fix all option in RubyMine

ckib16
  • 383
  • 4
  • 8
6

Suppose you have a double quoted string as "some_string" then you need to select all "some_string" including both the quotes and press quote key to get 'some_string' i.e single quoted string. To get the double quotes 'some_string' => "some_string" follow the same process and press shift+quote key. Hope your problem is solved @Martin.

sansarp
  • 1,446
  • 11
  • 18
  • @MartinCleaver both of these answers seem acceptable for your question, but I would vote for this one in conjunction with using ctrl+w until the entire string with quotes is selected because it's quicker for me. Just wondering why one hasn't been accepted? – mrfreester Nov 18 '15 at 20:26