Atom Packages Directory

a package directory for a text editor of the 21st Century

Shebang Set Grammar

Install with:
    apm install shebang-set-grammar

shebang-set-grammar Atom package

shebang-set-grammar is a package for Atom that auto-detect the files’ grammar from the shebang.

When opening a file with Atom, let’s say a Python file for instance, Atom automaticaly set the Python grammar (syntax highlighting). This is done by looking at the file extension “.py”. Atom knows that a .py extension means Python. “.sh” => shell, “.php” => PHP, “.js” => Java script…

But, as a Unix user, I often write scripts without defining the script language in the file extention. I prefer to make the file executable and define how to execute it in the shebang:

In that case, when Atom open this file, the grammar is not detected. I can define it manually in Atom but I would prefer if it would be done automaticaly by reading the shebang.

This is what this module is doing!

Process description

Keywords: grammar, shebang, #! Suggest keywords
Fork me on GitHub