1

I am creating some python files with extensions .pyt. Every thing is working fine except syntax highlighting.

My new .pyt files are not syntax highlighted as normal .py files do.

Ofcourse, I can change in

view>Highlight Mode> Script > python  

manually for every file, but there are around 1200 files and they keep growing. I really dont want to do this manually for each file for the the first opening.

Is there any way to apply default python syntax highlighting to my new .pyt files.

Any Help will be highly appriciated.

P.S. I have read how to do this for gedit 2.0 in many pages like page1, page2 and many more pages but couldn't find any good working processes for gedit 1.0.

Community
  • 1
  • 1
Sravan K Ghantasala
  • 1,058
  • 8
  • 14

1 Answers1

0

Although you (the OP) wrote that you found pages that were meant for gedit 3, I'm going to suggest that you look at this question.

Basically, even if gedit 1.0 used an older version of gtksourceview, as long as you can find the python.lang file in your system and change it, you can probably make it work. After all, it must have some way of specifying on which files it's used.

For new (Gtksourceview 2.0) lang files, this is done by adding either the mimetypes or globs property within the language's tag. So when you find the python.lang file, look for the *.py extension, and see if you can add *.pyt there, as is detailed in the question I linked above.

Community
  • 1
  • 1
Eyal
  • 3,412
  • 1
  • 44
  • 60