Better line wrapping in Vim

So I wanted Vim to visually wrap long lines, but take the indentation of the line into account when it does so. Apparently, Vim can't do that but back in 2007 Vaclav Smilauer posted a patch for Vim to add that feature. I updated the patch to apply to the current version of Vim in Fedora 11, 7.2.148-1.fc11. To get this behaviour, rebuild vim with this patch, then set breakindent. It isn't bug-free; it appears to interact badly with set linebreak. But you can combine it with set showbreak=.. or set showbreak=\ \ to provide a little bit of additional indent to the wrapped portion of the lines.

  • Posted: 2009-11-20 17:10 (Updated: 2011-12-19 23:17)
  • Author: retracile
  • Categories: vim

Attachments

Comments

No comments.