7

In the code editor for IntelliJ 2019, I want to add a straight double-quote (QUOTATION MARK) to the currently-selected text to make it a string literal.

Is there some keystroke or menu item to make this happen?

1
  • The String Manipulation plugin can do that... Commented Jul 5, 2019 at 18:49

3 Answers 3

13

The verified answer is correct, but if you are wondering what the shortcut is for these smart keys, highlight the text you wish to surround and press the key you wish to surround that text with.

Sign up to request clarification or add additional context in comments.

Comments

10

Settings > Editor > General > Smart Keys > Surround selection on typing quote or brace

Yes, it's under Settings > Editor > General > Smart Keys and is called Surround selection on typing quote or brace.

If activated, you can utilize this feature by simply selecting the relevant text and pressing the single or double quote key.

Settings > Editor > General > Smart Keys

3 Comments

Thanks but where is the shortcut ?
works flawlessly! @FarbodAprin there is no shorcut. Select the text and press quote key
for me it works with braces but not with quotes, everytime I select some text and try to add quotes the text is erased, im using rubymine on macos
0

On my device (macOS) I also faced the same problem and struggled with (double) quoting my selection. I tried an another text editor like Sublime and faced the same issue. However, I found out that it needs to be used with ctrl-key.

  • For single quoting selected text: Hit ctrl + '

  • For double quoting selected text: Still haven't figured it out.

Note: It depends on which keyboard (globally) you are using for your macOS device. In my case I'm using the 'US International - PC'. For 'US' you don't need to hit the ctrl-key.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.