I'm editing Linux init.d
scripts with Intellij IDEA 12 Ultimate and would like it to use Bash syntax highlighting. I already have the Bash syntax highlighting plugin, and it works great for files ending in .sh
. The problem with the init.d scripts is they have no extension, and it seems the only way to get Intellij to recognize a files type (Preferences -> File Types -> Registered Patterns) is by extension. If Registered Pattern supported paths (like */etc/rc.d/init.d/*
) that would be swell, but that doesn't seem to work.
The only workaround I've found for now is to add the name of each script I want to edit to Registered Patterns. Better than nothing, but does is there a better way? Thanks!
Press Ctrl+Alt+S to open the IDE settings and select Editor | File Types. Click Associate File Types with IntelliJ IDEA and select the file extensions you want to open with the IDE. Click OK and close the dialog.
To toggle read-only attribute of a file, open file in the editor, or select it in the Project tool window. Do one of the following: On the main menu, choose File | File Properties | Make File Read-Only , or Make File Writable .
You can use the *.
pattern. Though it's registered for Text files
type by default.
If you happen to have previously registered a file with IntelliJ (ex. when you initially create the file) that the file should be interpreted as Text this would add your file to the default mapping for Text in preferences. If you intend to create a file as Bourne Again Shell (aka bash) then at this point just tell IntelliJ that is what you intend. Otherwise you will need to manually go and remove these custom mappings from preferences before these files will show up for Bourne Again Shell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With