VIM textwidth has no effect

前端 未结 7 1641
遥遥无期
遥遥无期 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:59

    I had this exact same issue and found the following solved the issue well enough for me:

    autocmd FileType python setlocal textwidth=79 formatoptions+=t
    

    Feel free to change python to be your file type of choice (e.g. * or comma separated list python,ruby,go,sh,javascript)

    See :h fo-table for details of formatoptions

提交回复
热议问题