0

For example I want to force VS Code to always add an empty line at the end of all files on save.

I have to:

  1. Open VS Code
  2. Go to preferences
  3. Search for Insert Finale Newline
  4. Check it

Can I use bash to set this an other settings?

The reason I'm asking for this, is that we want to create a configure-vs-code.sh script that we can run on any VS Code to configure it as we want.

Ali EXE
  • 853
  • 1
  • 7
  • 21

1 Answers1

1
  1. You should use the setting.json file, here is an answer to find it.

  2. And to be able to edit it, you can use the json npm package.

  3. Finally it should look something like this:

setting.json

{
    "keys":
    {
        "insert_finale_newline": false
    }
}

configure-vs-code.sh

json -I -f $HOME/.config/Code/User/settings.json -e "this.keys.insert_finale_newline=true"
Chefaku
  • 68
  • 3