VIM textwidth has no effect

前端 未结 7 1510
遥遥无期
遥遥无期 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 17:57

    I am using Neovim and have met this issue too. After setting textwidth to 80 in my init.vim, the content of a text file does not change when I open the file. For the existing text, we have to manually format it with gggqG.

    When you type new characters in a line, the textwidth option will work (you will get a linebreak automatically if the character number reaches 80).

提交回复
热议问题