Adam
Adam

Reputation: 3128

Associate extensionless files to Bash

My Bash scripts do not have any extensions nor shebang line. How can I avoid having to select the syntax highlighter when I open every file for this project?

Upvotes: 2

Views: 451

Answers (1)

Gama11
Gama11

Reputation: 34128

The files.associations setting allows matching against arbitrary glob patterns, not just file extensions. For instance, for a Bash script named start, you could have the following in your workspace's settings.json:

"files.associations": {
    "start": "shellscript"
}

You can also have a comma-separated list of file names between {}:

"files.associations": {
    "{start,stop}": "shellscript"
}

Upvotes: 4

Related Questions