How to surround selected text in PyCharm like with Sublime Text

后端 未结 3 1900
闹比i
闹比i 2020-12-08 00:05

Is there a way to configure PyCharm to be able to surround selected code with parenthesis by just typing on the parenthesis key, like when we use SublimText 2?

相关标签:
3条回答
  • 2020-12-08 00:12

    PyCharm 4.0 has the option to Surround With..., by selecting your code snippet and pressing

    ctrl + alt + T

    or on Mac: + + T

    Option 1 should provide you with the functionality you are looking for:

    PyCharm Ctrl+Alt+T

    0 讨论(0)
  • 2020-12-08 00:21

    Windows: open pycharm and select file, settings, Editor, Smart Keys, in the list you will check "Surround selection on typing quote or brace", then apply. enter image description here

    Image of pycharm location of smart keys

    0 讨论(0)
  • 2020-12-08 00:32

    I think you want something like

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

    0 讨论(0)
提交回复
热议问题