Smart Wrap in Vim

后端 未结 8 1469
离开以前
离开以前 2020-12-02 06:28

I have been wondering if Vim has the capability to smart wrap lines of code, so that it keeps the same indentation as the line that it is indenting. I have noticed it on som

8条回答
  •  温柔的废话
    2020-12-02 07:02

    There is a patch for this, but it's been lingering for years and last time I checked did not apply cleanly. See the "Correctly indent wrapped lines" entry in http://groups.google.com/group/vim_dev/web/vim-patches -- I really wish this would get in the mainline.

    Update: that link seems to have bitrotted. Here is a more up to date version of the patch.

    Update 2: it has been merged upstream (as of 7.4.345), so now you only have to :set breakindent.

提交回复
热议问题