gedit - Can't install custom syntax highlighter file

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Bainespal

gedit - Can't install custom syntax highlighter file

Post by Bainespal »

Someone else wrote a gedit GTKSourceview syntax highlighter definition file (with a .lang extension) for a rare high-level language used for creating text adventure games. I've been trying to install the file, but I can't get syntax coloring to appear or make gedit recognize the source file type.

The wiki for the text adventure language says that the .lang file needs to be moved to either /usr/share/gtksourceview-3.0/language-specs or /usr/share/gtksourceview-2.0/language-specs. I have copied the file into both directories, with no result.

Having searched the Internet fairly extensively, it looks like some people say that gedit syntax highlighters should go in /.local/share/gtksourceview-2.0/language-specs. That directory did not exist on my Linux Mint system, but I created it anyways and copied the .lang file there just to try it. I also created a parallel /.local/share/gtksourceview-3.0/language-specs and put another copy of the file there. Still, nothing.

I've been using Linux for about a year, but I still don't understand the file system. Help would greatly appreciated.

I'm using Linux Mint 15 Cinnamon with gedit 2.30.4.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: gedit - Can't install custom syntax highlighter file

Post by xenopeek »

Have you validated the file? Go to /usr/share/gtksourceview-2.0/language-specs:

Code: Select all

cd /usr/share/gtksourceview-2.0/language-specs
Run the validator:

Code: Select all

bash check.sh
If you get an error about xmllint not being found, install the package libxml2-utils first:

Code: Select all

apt install libxml2-utils
Anyway, by moving one of the .lang files out of the /usr/share/gtksourceview-2.0/language-specs directory and then starting Gedit 2.30.4 again I've confirmed that this is the right directory to place .lang files. Gedit no longer showed this language is the syntax selection box at the bottom of the window. It showed it again once I moved the .lang file back into this directory and restarting Gedit.

Do you have a download link for the syntax file?
Image
Bainespal

Re: gedit - Can't install custom syntax highlighter file

Post by Bainespal »

Thank you.
xenopeek wrote:Run the validator:

Code: Select all

bash check.sh
I do not get an error about xmllint. When I'm not logged in as root, I get a warning about the syntax file I'm interested in as well as two identical I/O "Permission denied" errors:

Code: Select all

warning: failed to load external entity "hugo.lang"
When I log in as root with the su command, hugo.lang appears to validate normally with all the other syntax files, but I get this warning:

Code: Select all

warning: failed to load external entity "*.xml"
xenopeek wrote:Do you have a download link for the syntax file?
http://roody.gerynarsabode.org/hbe/synt ... /hugo.lang
xenopeek wrote: Anyway, by moving one of the .lang files out of the /usr/share/gtksourceview-2.0/language-specs directory and then starting Gedit 2.30.4 again I've confirmed that this is the right directory to place .lang files. Gedit no longer showed this language is the syntax selection box at the bottom of the window. It showed it again once I moved the .lang file back into this directory and restarting Gedit.
That's very valuable information. Thanks!
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: gedit - Can't install custom syntax highlighter file

Post by xenopeek »

I don't have Linux Mint 15 here any longer, but Linux Mint 16 works just fine. I put your file in the /usr/share/gtksourceview-2.0/language-specs directory, ran the validator and then ran Gedit. I could select it easily. I think you are doing something wrong/different than what I am doing. Perhaps learn to use sudo as logging in to your system as root is just asking to run into problems :(

Obligatory proof (click to enlarge):
Image
Image
Locked

Return to “Software & Applications”