VIM textwidth has no effect

前端 未结 7 1593
遥遥无期
遥遥无期 2021-02-01 17:19

This feels like a dumb question, but I can\'t find an answer on the Internet (or in VIM help). I\'m using VIM 7.2 on Mac OS X. All I want to do is wrap my lines at 72 characters

7条回答
  •  青春惊慌失措
    2021-02-01 18:05

    Vim won't do anything unless requested. textwidth will have an effect for currently edited lines if you either have t (for non-comments only), c (for comments only) or both in formatoptions (if a is not present there, then it will autowrap only when you reach the margin set by textwidth), or if you use gq to reformat your text. If I am not mistaking, you can set such formatexpr or formatprg so that textwidth will be ignored.

提交回复
热议问题