I think it would be very useful for TextMate to identify the type of a script file based on the shebang line. This would be particularly useful for scripts without suffixes. In my opinion, an identification made this way would take precedence over one done based on the file suffix.
For example if the first line of the script named "do_some_stuff" was "#!/bin/env bash", then the file type would be a Bourne Shell script file and Shell script (bash) syntax would be turned on.
On 22 Aug 2007, at 20:44, Alain O'Dea wrote:
For example if the first line of the script named "do_some_stuff" was "#!/bin/env bash", then the file type would be a Bourne Shell script file and Shell script (bash) syntax would be turned on.
The shell script grammar includes the following:
firstLineMatch = '^#!.*(bash|zsh|sh|tcsh)';
so this should work already.
Try this from Terminal:
echo '#!/bin/env bash' | mate
Very nice. Off hand I used Bash as an example (without checking it, oops :0) because I wasn't getting syntax highlighting in Erlang script and thought it was too obscure. I'll try adding firstLineMatch to the Erlang bundle. Thank you :)
On 8/22/07, Ciarán Walsh ciawal@gmail.com wrote:
On 22 Aug 2007, at 20:44, Alain O'Dea wrote:
For example if the first line of the script named "do_some_stuff" was
"#!/bin/env bash", then the file type would be a Bourne Shell script
file and Shell script (bash) syntax would be turned on. The shell script grammar includes the following:
firstLineMatch = '^#!.*(bash|zsh|sh|tcsh)';
so this should work already.
Try this from Terminal:
echo '#!/bin/env bash' | mate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate