Python 如何像 Sublime Text 一样在 PyCharm 中包围选定的文本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27152414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to surround selected text in PyCharm like with Sublime Text
提问by Alexis Benoist
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?
有没有办法将 PyCharm 配置为能够通过在括号键上键入来用括号括起选定的代码,就像我们使用 SublimText 2 时一样?
采纳答案by Arnaud P
I think you want something like
我想你想要类似的东西
Settings | Editor | General | Smart Keys-> Surround selection on typing quote or brace
Settings | Editor | General | Smart Keys-> Surround selection on typing quote or brace
回答by Andy
回答by Adam H
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
Windows:打开 pycharm 并选择文件、设置、编辑器、智能键,在列表中您将选中“键入引号或括号时的环绕选择”,然后应用。 在此处输入图片说明


