如何强制Intellij突出显示没有扩展名为Bash的文件? [英] How to force Intellij to highlight file with no extension as Bash?
问题描述
我正在使用Intellij IDEA 12 Ultimate编辑Linux init.d
脚本,并希望它使用Bash语法高亮显示。我已经有了Bash语法高亮插件,它适用于以 .sh
结尾的文件。 init.d脚本的问题是它们没有扩展名,似乎让Intellij识别文件类型(首选项 - >文件类型 - >注册模式)的唯一方法是扩展。如果注册模式支持的路径(如 * / etc / rc.d / init.d / *
)会膨胀,但这似乎不起作用。
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!
推荐答案
您可以使用 *。
模式。虽然默认情况下已注册文本文件
,但
You can use the *.
pattern. Though it's registered for Text files
type by default.
这篇关于如何强制Intellij突出显示没有扩展名为Bash的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!