Hello, I'm trying to make gedit automatically highlight *.as files when I open them. Here is what I've done so far:
1) I created a custom highlight spec in /usr/share/gtksourceview-2.0/language-specs/actionscript3.lang. This is the head of the file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language id="actionscript3" _name="ActionScript 3" version="1.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-actionscript3</property>
<property name="globs">*.as</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
.
.
.
Now I can select it inside gedit with View > Highlight Mode > Sources > ActionScript 3 and it works fine.
2) I created a custom mimetype in the following locations with the following data
~/.mime.types
text/x-actionscript3 as
/usr/share/mime/packages/freedesktop.org.xml
<mime-type type="text/x-actionscript3">
<comment>AS3 source code</comment>
<generic-icon name="text-x-generic"/>
<glob pattern="*.as"/>
<sub-class-of type="text/plain"/>
</mime-type>
~/.local/share/mime/packages/actionscript3.xml
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-actionscript3">
<comment>ActionScript 3 Source</comment>
<!-- more translated comment elements -->
<glob pattern="*.as"/>
</mime-type>
</mime-info>
and restarted. Now both nautilus and gedit recognize .as files as text/x-actionscript3. However I still have to manually select ActionScript Highlight from the menu. Is there something else I can try?
Thank you for your time.
Heron Anzures.
Bookmarks