Automatically hard wrap lines at column in VSCode

后端 未结 6 1502
刺人心
刺人心 2020-11-29 19:11

How can I automatically hard wrap lines in VSCode? By that I mean if a line reaches a specified column, automatically insert a newline at the word boundary closest to that c

6条回答
  •  攒了一身酷
    2020-11-29 19:37

    As of 2020 and if you're using the Prettier - Code formatter plugin:

    Go to Plugins -> Find Prettier -> Cog -> Extension Settings -> Prettier: Print Width Fit code within this line limit and set to whatever you want. By default it's 80.

    When you save the file, Prettier will format automatically.

提交回复
热议问题