Brenton Horne Brenton Horne - 6 months ago 31
Bash Question

How to associate .install file extension and PKGBUILD file name with shell scripts in VSCode?

In Visual Studio Code I have tried to associate

*.install
(i.e., files with the extension
.install
) and PKGBUILD files with shell script syntax highlighting, using:

// Place your settings in this file to overwrite the default settings
{
"file.associations": {
"PKGBUILD": "shell",
"*.install": "shell-script",
"*.desktop": "ini"
}
}


but it hasn't worked (for either file name/extension), that is, neither file name/extension is getting syntax highlighting from shell. I have tried changing
shell
/
shell-script
with
shellscript
, after looking at the shellscript package's source code (https://github.com/Microsoft/vscode/blob/master/extensions/shellscript/package.json).

Answer

You're missing the "s" in "files":

{
    "files.associations": {
        "PKGBUILD": "shellscript",
        "*.install": "shellscript",
        "*.desktop": "ini"
    }
}

Once the setting is corrected, you can use any of the aliases in the file you linked https://github.com/Microsoft/vscode/blob/master/extensions/shellscript/package.json