在PyCharm中换行注释 [英] Wrapping comments with line breaks in PyCharm

查看:1746
本文介绍了在PyCharm中换行注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有评论,获取气球(PEP 8:行太长...> 120)
我希望有一个命令,几行键。
现在,即使我键入 Alt + Enter ,然后在重新格式化文件上按输入变化。是否有可以轻松完成格式化的设置或插件?

I have comments that gets balloon (PEP 8: Line too long ... > 120) I wish there was a command that will wrap the lines with few keystrokes. Right now, even if I type Alt+Enter and press enter on Reformat file, nothing actually changes. Is there a setting or plugin I could use to accomplish the formatting easily?

推荐答案

首先,重新格式化不会工作,至少Python,其中whitespace是重要的。 PyCharm的包装时打字到达右边距选项是你要找的。现在这不会工作,当你复制和粘贴代码,但在它给你麻烦的地方,只要按enter键,它会工作。

Firstly, reformatting won't work, not in Python at least, where whitespace is important. PyCharm's "Wrap when typing reaches right margin" option is what you're looking for. Now this will not work when you copy and paste code, but in the places where it gives you trouble, just press enter, and it will work.

这篇关于在PyCharm中换行注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆