title: In PyCharm, keeping a certain page width without constantly editing line breaks or using word wrap
body: <p>This problem has bothered me since I began programming many years ago, and I figured I would ask you all what you think. I've been told this problem is tool-specific, so this question is about doing it in PyCharm.</p>
  
  <p>Say you are not using word-wrap. Now you need to edit a bunch of multiline comments like:</p>
  
  <pre><code># I had some thoughts here which I thought I
  # would share. They're a bit long, so I need
  # to extend them across several lines.
  </code></pre>
  
  <p>Then say you want to edit the comment. So here's your edit:</p>
  
  <pre><code># I had some thoughts here about programming best practices which I thought I
  # would share. They're a bit long, so I need
  # to extend them across several lines.
  </code></pre>
  
  <p>Oops, your new text makes the first line quite long. Let's break that into a new line:</p>
  
  <pre><code># I had some thoughts here about programming 
  # best practices which I thought I
  # would share. They're a bit long, so I need
  # to extend them across several lines.
  </code></pre>
  
  <p>Hmm that second line is a bit short, let's bring some text up from the third line:</p>
  
  <pre><code># I had some thoughts here about programming 
  # best practices which I thought I would share. 
  # They're a bit long, so I need
  # to extend them across several lines.
  </code></pre>
  
  <p>Uh-oh, now that third line is too short, let's bring text up from the fourth line:</p>
  
  <pre><code># I had some thoughts here about programming 
  # best practices which I thought I would share. 
  # They're a bit long, so I need to extend them 
  # across several lines.
  </code></pre>
  
  <p>All done. But that was annoying, right? I can't believe I took the time to post this question. But I feel like I'm spending too much time fixing comments like this, and I wonder if I'm missing a better solution. Have any editors implemented one? </p>
  
  <p>The natural answer is "add word wrap." But in word-wrap, unless I'm misunderstanding it, you'd just have one really long line beginning with # per paragraph, and anybody reading your code without word-wrap capabilities will hate you.</p>
  
  <p>Here is how I think this question is different from the linked question: I'd like to enforce a certain width for comments, regardless of what column they happen to be on (e.g. max width 60, so comments starting on line 0 can't extend beyond line 60, but comments starting on line 30 can't extend beyond line 90, etc). This is because comment readability really has to do with how wide they are.</p>
  
  <p>This is different from merely wrapping at column X because then your comments will be different widths depending on how much indentation they have.</p>
  
  <p>Additionally, I don't really want to change the width of my code with this solution, although I'll do it if I have to.</p>