Shop OBEX P1 Docs P2 Docs Learn Events
Gedit Spin Syntax Highlighting -> Solution! — Parallax Forums

Gedit Spin Syntax Highlighting -> Solution!

SRLMSRLM Posts: 5,045
edited 2012-05-17 01:01 in Propeller 1
I develop for the Propeller on Ubuntu Linux, and I prefer to use Gedit for my editor. I have written a syntax highlighter file for Spin/PASM, and it's available at the bottom of this post.

Installation Instructions:
1. Download the spin.lang file, and put it here: /usr/share/gtksourceview-3.0/language-specs/ folder
2. Restart Gedit
3. Done!

It doesn't work! What should I do?
--- Look for option "Spin" under View->Highlight Mode->Sources->Spin
--- Try putting it in /usr/share/gtksourceview-2.0/language-specs/ folder
--- Not using a recent edition of Ubuntu? Try doing a google search for your OS on where to install .lang files.

Known Issues:
1. When you create a new Spin file in the editor, it doesn't do highlighting by default (reload file or see first debug option above)
2. It doesn't highlight correctly numbers with an underscore
3. Some PASM keywords appear hightlighted in Spin sections, and vice versa
4. You prefer emacs. No solution, but a workaround can be found here.

Note that these issues don't affect the actual code, just how it's displayed to you.

As a related note, you can compile the code with BSTC, available here. Here is the BSTC command that I use to compile code:
./bstc.linux -f -p0 -l -w1 -L test -L lib -L lib/bma filename.spin
This will compile with three folders for library files, generate a listfile (memory/code breakdown of compiled program), give errors and warnings, and download at double data rate to the propeller into RAM and run.

Once on the Propeller, I use picocom or cutecom to get the serial data from the USB connection.

Edit: and once again, I get bit by the forum software. The spin.lang file is in the .zip file.

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-05-17 01:01
    I've been using medit for awhile now instead of gedit for a good reason that I have since forgotten about (It'll come back to me). However it has some nice features and is somewhat similar to gedit except that the find command is a more standard F3 etc. I'm guessing this Spin highlighter should work for medit as well perhaps with very little work but I will have to have a look at this later.
Sign In or Register to comment.