How to surround code by curly braces in IntelliJ IDEA?

后端 未结 7 2071
予麋鹿
予麋鹿 2021-02-03 16:50

How to surround code by curly braces in IntelliJ IDEA? Is there any keyboard-shortcut for such operation?

7条回答
  •  攒了一身酷
    2021-02-03 17:36

    Just configure Smart Keys as follow:
    IDE Settings > Editor > General > Smart Keys > Surround selection on typing quote or brace.

    From the IntelliJ built-in help:

    If this check box is selected, the selected text on typing a quote, double-quote or brace, will be surrounded with these characters.

    If this check box is not selected, then the typed quotes, double-quotes or braces will replace the selection.

提交回复
热议问题