visual-studio-codeindentationauto-indent

How can I reindent all files in a workspace at once in VS Code?


I'd like to reindent all files in a VS Code project, after changing indentation configuration. I can perfectly reindent a single file by opening it and running the Reindent Lines command. But I don't want to do that for every file in the project, as there are to many.

Is there a way to convert indentation in a whole project, e.g. by applying Reindent Lines to folders or multiple files at once?

enter image description here


Solution

  • You can use rioV8's extension: Command on All Files (I have no affiliation with this extension).

    I found this from this Q&A: How to execute command across multiple files in VS Code?.