有没有办法将 PyCharm 配置为能够通过在括号键上键入来用括号括住选定的代码,就像我们使用 SublimText 2 时一样?
我想你想要类似的东西
Settings | Editor | General | Smart Keys
-> Surround selection on typing quote or brace
PyCharm 4.0 可以选择 Surround With...
,方法是选择您的代码片段和 pressing
ctrl + alt + T
或在 Mac 上:⌥ + ⌘ + T
选项 1 应该为您提供您正在寻找的功能:
https://i.stack.imgur.com/H80b6.png
Windows:打开 pycharm 并选择文件、设置、编辑器、智能键,在列表中您将选中“键入引号或大括号时的环绕选择”,然后应用。 enter image description here
Image of pycharm location of smart keys
File | Settings
而不是Preferences
Preferences
而不是Settings
SHIFT
+'
例如。