To format a code file, let's say a Javascript file or an HTML file, open it in VS Code and press Ctrl + Shift + I.
Can I somehow use this feature in bash?
Is it possible to use code and pass it the file path and the command in terminal?
To format a code file, let's say a Javascript file or an HTML file, open it in VS Code and press Ctrl + Shift + I.
Can I somehow use this feature in bash?
Is it possible to use code and pass it the file path and the command in terminal?
According to the documentation, VS Code uses js-beautify for HTML and JS formatting, so you could simply install that and use it directly in bash:
$ npm -g install js-beautify
$ js-beautify foo.js