Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make text wrapping match current indentation level in vim?
    primarykey
    data
    text
    <p>Does anyone know of a way to get vim to wrap long lines of text such that the position of the wrapped text is based on the indentation of the current line? I don't want to reformat my code, just for it to be displayed prettily.</p> <p>For instance, if I set my settings so that the line:</p> <pre><code>print 'ProcessorError(%r, %r, %r)' % (self.file, self.index, self.message) </code></pre> <p>is displayed when wrapped as:</p> <pre><code>print 'ProcessorError(%r, %r, %r)' % (self.file, self.index, self.message) </code></pre> <p>then if I write a block of code like this:</p> <pre><code> def __repr__(self): return 'ProcessorError(%r, %r, %r)' % (self.file, self.index, self.message) </code></pre> <p>it wraps to something like this:</p> <pre><code> def __repr__(self): return 'ProcessorError(%r, %r, %r)' % (self.file, self.index, self.message) </code></pre> <p>I would prefer for it to be displayed as:</p> <pre><code> def __repr__(self): return 'ProcessorError(%r, %r, %r)' % (self.file, self.index, self.message) </code></pre> <p><strong>Edit:</strong> after reading Don Werve's response, it seems that I am indeed looking for the <code>breakindent</code> option, but the option is still on the "Awaiting updated patches" list (see <a href="http://vimdoc.sourceforge.net/htmldoc/todo.html" rel="noreferrer">Vim TODO</a>). So what I'd like to know is what is the <em>easiest way</em> to get vim working with <code>breakindent</code>? (I don't care what version of vim I have to use.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload