title: How can I fix Vim's line breaking behavior for long lines in Python?
body: <p>So here's my problems. Let's say I have a Python file and I'm typing a really long line, like the last one here:</p>
  
  <pre><code>class SomeClass(object):
    def some_method(self):
      some_variable = SomeOtherClass.some_other_method(some_parameter=some_value)
  </code></pre>
  
  <p>When I type this in Vim, this happens:</p>
  
  <pre><code>class SomeClass(object):
    def some_method(self):
      some_variable =
      SomeOtherClass.some_other_method(some_parameter=some_value)
  </code></pre>
  
  <p>That's not just bad style, it breaks PEP8. What I'd like to happen is:</p>
  
  <pre><code>class SomeClass(object):
    def some_method(self):
      some_variable = SomeOtherClass.some_other_method(
          some_parameter=some_value)
  </code></pre>
  
  <p>Which is in keeping with <a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP8</a>. (For the purposes of this discussion, I'm only interested in the line breaking behavior, not the indentation behavior.)</p>
  
  <p><strong>Edit:</strong> <code>breakat</code> only works in conjunction with <code>linebreak</code> to govern how lines are displayed. It does not (apparently) work in conjunction with <code>textwidth</code> to determine where hard line breaks are inserted. So my idea below will not work...</p>
  
  <p>Surprisingly, I have found nothing out there indicating others share this problem, which leads me to think I'm doing something wrong. Nevertheless, my idea was to add the <code>(</code> character to the <code>breakat</code> setting (along with <code>[</code> and <code>{</code> while I was at it).</p>
  
  <p>I've tried this; here's the output of <code>:set breakat</code>:</p>
  
  <pre><code>breakat= ^I!@*-+;:,./?([{
  </code></pre>
  
  <p>However, it's to no avail. No matter what I do, Vim insists on breaking after the "=" above. I have this same problem with long function names as well, where it'll break right after <code>def</code>.</p>
  
  <p>Here are the complete contents of my .vimrc:</p>
  
  <pre><code>set nobackup
  set nowritebackup
  set noswapfile
  set columns=80
  set tabstop=4
  set shiftwidth=4
  set softtabstop=4
  set autoindent
  set smarttab
  set smartindent
  set textwidth=80
  set wrap
  set breakat=\ ^I!@*-+;:,./?\(\[\{
  filetype indent on
  filetype on
  filetype plugin on
  </code></pre>
  
  <p>(I have no plugins etc. installed for the purpose of trying to figure this out.)</p>
  
  <p>Does anyone have any idea how I can get Vim to obey my breakat setting, or any other thoughts about the best way to deal with this behavior? </p>