RubyMine: key press to "convert to single quoted"?
Asked Answered
M

3

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.

Mettlesome answered 6/3, 2015 at 15:54 Comment(0)
D
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.

Diapositive answered 7/3, 2015 at 18:50 Comment(0)
D
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

Donalt answered 4/8, 2016 at 18:26 Comment(0)
C
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.

Charliecharline answered 7/3, 2015 at 16:32 Comment(1)
@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?Uncle

© 2022 - 2024 — McMap. All rights reserved.