Visual Studio Code - delete all blank lines - regex

后端 未结 15 1221
心在旅途
心在旅途 2021-01-29 18:36

I spent some time trying to figure out how to delete all blank lines in Visual Studio Code and I can\'t get it working. Anybody knows how to do it please?

If I search fo

15条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 19:05

    I don't know about yout, but memorize a lot of commands for me seams a waste of time!

    Use the extension "Blank Line Organizer", here's the description:

    This extension will help you organize blank lines in the code by removing multiple blank lines. The extension removes blank lines only from the selected lines if any, otherwise from the entire file

    How to use it: check the description of extension, but it really seams nice!

    blankLine.triggerOnSave boolean true    If set to true, the command will be triggered on save.
    

    In other words, after save the file, it automatically cleans up!

提交回复
热议问题