Word Wrap in Vim (preserving indentation)

后端 未结 4 1318
南旧
南旧 2021-01-31 00:53

I was just looking at this post which describes how to wrap entire words in vim. The accepted solution was this:

:set formatoptions=l
:set lbr

4条回答
  •  无人及你
    2021-01-31 01:44

    The breakindent patch has what you're looking for. I successfully applied it using instructions found in this thread:

    Patch Vim with the breakindent patch on OS X with Homebrew

    Specifically, echristopherson's Homebrew formula.

    I know this thread is old but it's popular on google and I came across it multiple times when trying to find a solution.

    EDIT: This patch is now included with vim as patch 7.4.338. See: https://retracile.net/blog/2014/07/18/18.00

    On Yosemite (Mac OS X), I used snowbound's command with hombrew:

    brew install macvim --with-features=huge --override-system-vim --HEAD 
    

提交回复
热议问题