21
4
Vim/gvim will wrap long lines like this:
000000000000000000000000000000000000|
00000000000000 |
11111111111111111111111111111111|
111111111111111111 |
22222222222222222222222222222222|
222222222222222222 |
3333333333333333333333333333|
3333333333333333333333 |
Is there a way to get Vim to wrap those lines like this instead:
000000000000000000000000000000000000|
00000000000000 |
11111111111111111111111111111111|
111111111111111111 |
22222222222222222222222222222222|
222222222222222222 |
3333333333333333333333333333|
3333333333333333333333 |
I want the wrapped line to start a little past the indent of where that line started. (Just to be clear, I'm talking about wrap, not textwidth.)
I want the indentation of the line to be considered in the wrapping of that line so that the code structure isn't hidden by wrapped lines.
1As of today (June 25, 2014) the breakindent patch is officially part of Vim 7.4 -- it is added by patch 338 and 345. – Heptite – 2014-06-25T21:21:13.720
@Heptite Thank you for the heads-up! – retracile – 2014-07-03T02:40:08.273
1
As Fedora releases updates to Vim, I'm updating the patch. See https://retracile.net/wiki/VimBreakIndent for the latest.
– retracile – 2010-11-23T04:16:16.720Bonus points to someone who can explain how to get this to work with MacVim. – donut – 2011-03-29T20:01:15.250
Where is the patch? That site doesn't link to any I can see – puk – 2012-02-23T11:57:54.470
@puk: Sorry, a major software upgrade had changed some link locations. I've fixed those now. – retracile – 2012-02-24T17:17:44.037
Le awesome! Thanks a lot, works like a charm on top of vim-7.3.944 on Fedora 19. For those like me who didn't know: Here's how to patch and recreate an RPM.
– nidi – 2013-07-08T00:22:10.627