Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

recognize bash file with no extension in phpstorm

Tags:

phpstorm

I'm using the last version of PHPStorm, which is 7 I think and want to have file support for files using a pattern such as *.extension but those don't have an extension. I tried pattern *, which works, but puts all of my files in bash highlighting.

Does anyone have a solution for that without using the .sh extension?

Edit: Bash file are recognize with extension .sh and .bash. It's working nicely, but what I want is to set default file type on files with no extension. If I add .* or * in the list of bash file, all my files are recognize like bash file. Hope it's more clear, sorry for the probable mistake in my English.

like image 936
GuiDrn Avatar asked Nov 28 '13 09:11

GuiDrn


People also ask

Do Bash files need .sh extension?

Its usually . sh , but the extension isn't required to exist at all. Linux is not Windows. The program that shall interpret your script is determined in its first line, that should be #!/bin/bash .

What is the extension for bash file?

Normally, a Bash script file has . sh extension to make it clear that it is a shell script file.


1 Answers

It may seem weird - but you can try to actually list the files you're using explicitly reading their names.

Not sure of your use-case, but I needed it for git hooks, and there's not so much names for existing git hooks, so it's not that hard to list those :)

For the reference: Preferences > Editor > File Types > Bourne Again Shell:

enter image description here

like image 113
Slayer Birden Avatar answered Oct 16 '22 18:10

Slayer Birden