1

I have started a new thread rather then reviving this one:

Creating your own syntax highlighting in GEdit?

Hope that was the right thing to do. I have created a syntax file for fish shell and placed it in /usr/share/gtksourceview-2.0/language-specs (in Ubuntu). When I open a .fish file with gedit there is no highlighting and the view-->high light mode menu does not show this fish as an option. Is there something that needs to be updated to allow the file to be recognized?

Thanks for reading-Patrick

Community
  • 1
  • 1
Patrick
  • 21
  • 1
  • 3

2 Answers2

3

Make sure you are in fact using Gedit 2 and not Gedit 3 (which uses gtksourceview-3.0). For the newer, 3.0 lang files, you can put them into ~/.local/share/gtksourceview-3.0/language-spec/

If you've installed it to the correct location, you should see the name you specified in the _name attribute in the View > Highlight Mode menu under the sub menu you specified with the _section attribute in your .lang file. For example, if I had test.lang with:

<language id="test" _name="Test Language File" version="2.0" _section="Markup">

Then I would see "Test Language File" under View > Highlight Mode > Markup in the Gedit menu.

Micah Carrick
  • 9,967
  • 3
  • 31
  • 43
  • 3
    Another way to check to see (at least, in 3.x) is to launch `gedit` from the terminal - it will dump a note if there is an error trying to load – AJ. Mar 29 '12 at 04:42
0

As an alternative to /usr/share/gtksourceview-2.0/language-specs/, you could try putting it in ~/.gnome2/gtksourceview-2.0/language-specs/.

Assuming you've restarted gedit after installing your syntax file, then it may just be a syntax error. Try installing the Go syntax file (http://go-lang.cat-v.org/text-editors/gedit/), and if that shows up but your custom one still doesn't, then it's a problem with your file. If none of them show up, then you may need to re-install gedit or gtksourceview.

Also, make sure the permissions on your new file match those of the existing ones. I doubt gedit would need more than read permissions to be able to use the file, but it wouldn't hurt to check.

damien
  • 902
  • 1
  • 7
  • 12