ChatGPT解决这个技术问题 Extra ChatGPT

Pycharm to toggle soft wrap in code editor

If you know how to toggle soft wrap aka. word wrap while editing code in Pycharm, please share.

My google search and SO search give me no helpful result(s).

Trying to look in Pycharm setting/preference not helps either.

p.s.

I'm using PyCharm Community Edition 2016.2


S
SaeX

Right-click the the left side (with line numbering) and choose your soft wrap option:

https://i.stack.imgur.com/xTwsC.jpg


Oh, so hidden on line number ^^ - I actually tried right-clicking o empty spaces :D
it is really ugly though, the "newline" starts all the way at the left edge
D
Dan Gamble

https://i.imgur.com/Jq2gLbD.png

I'm sure one of these will be what you are after


J
Joseph Francis

There's also another way to accomplish this easily.

View -> Active Editor -> Soft-Wrap

The "View" is in the toolbar of Pycharm (Pycharm, File, Edit, View....)


N
Nagabhushan S N

If you want to permanently enable soft wrap for certain file extensions, it can be configured in Settings > Editor> General. Under the title Soft Wraps, add your required file extension.

https://i.stack.imgur.com/wZYRZ.png

The settings can also be accessed by right-click on the line-numbers and selecting Configure Soft Wraps as explained here. Also shown here.

https://i.stack.imgur.com/9uLGq.png

PS: I know it is not what is asked in the question, but this was the first google result when I searched for configuring soft wraps. So, I added the answer here in case anybody else comes looking up for the same.


N
Nagabhushan S N

For PyCharm community2020

Follow: File->Setting->Editor->General->soft-wrap these files

https://serving.photos.photobox.com/67985053472744554378094c117eaf4b49abd3378acad83ee4490a7e6f6e93a3652c10de.jpg

Checked:Soft-wrap these files and

Edit: *.py at the end followed by semicolon ';'

https://serving.photos.photobox.com/908477378c167e372ead4e1d62aaf7fa0ece9be6ee8c26da9db49d1020b0bee95821f451.jpg

Hope,this answered the question!


d
dhgoratela

Hit double shift and start typing what you want to do. softwrap

This will automatically selects the first action.

Just hit enter and voilà

https://i.stack.imgur.com/c1U2W.png