BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Cuneyt
Obsidian | Level 7

I know that there are SAS syntax highlighting extensions for various text editors like Notepad++, but is there a Gedit (text editor on Gnome) extension for SAS syntax highlighting? I am looking for syntax highlighting, not a full IDE. Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Cuneyt
Obsidian | Level 7

I have written a syntax highlighting file (sas.lang) and a color theme file (sascolors.xml) for editing SAS programs in Gedit. They are both XML files. I have kept these files as simple as possible, first because I am not a professional software developer, and second because I wanted these files to be updated easily. I have attached a zip file that contains both of these files.

 

SAS.LANG: This is the SAS language specification file for syntax highlighting in Gedit. It highlights the following:

  1. Comments between /* */ and * ;
  2. String within single and double quotes
  3. SAS procedures
  4. SAS statements, keywords, options, etc.

This file should be saved in the following directory:
/.local/share/gtksourceview-3.0/language-specs/ or /.local/share/gtksourceview-4/language-specs/

 

SASCOLORS.XML: This is a Gedit color theme for the SAS language. This file should be saved in the following directory:
/.local/share/gedit/styles

It highlights the following

  1. Comments in green
  2. Strings in purple
  3. SAS procedures in dark blue and bold
  4. SAS statements, keywords, options, etc. in light blue

View solution in original post

6 REPLIES 6
ChrisHemedinger
Community Manager

I'm not aware of anything for Gedit. The SAS extension for VS Code contains the most robust SAS syntax services/definitions that you can access in the open source world. And if Gedit supports language server extensions, some people have been able to adapt the SAS-VS Code project for use in other popular editors. See the GitHub project here and the discussions on this here.

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!
Cuneyt
Obsidian | Level 7

Hi Chris,

Thanks for your prompt reply. VS Code is not available in my work environment. But I must say that SAS has done an amazing job with the SAS extension for VS Code. In my work environment, I am writing SAS programs in a text editor and submitting them in batch mode. The only two text editors available to me are Gedit and Emacs. I know Emacs has ESS which provides SAS syntax highlighting, but I like the simplicity of Gedit. Gedit has small language extension files for syntax highlighting. I am not a software developer myself, but I thought writing a SAS extension file for Gedit would not be a major undertaking like the SAS extension for VS Code. Do you think SAS might be interested in producing a SAS syntax highlighting file extension for Gedit?

Sincerely,

Cuneyt

ChrisHemedinger
Community Manager

Hi @Cuneyt - probably not as a formal effort. We're really investing in VS Code as an experience, and we can share the efforts/data with our own SAS Studio and SAS Enterprise Guide IDEs.

 

However, you found our simple Notepad++ data and I have similar data already for prismjs (which we use on the community here), so happy to share that if it's of interest.

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!
Cuneyt
Obsidian | Level 7

Hi Chris, what do you mean by "Notepad++ data"? Do you mean the language definition?

ChrisHemedinger
Community Manager

Yes, what I published here:

 

https://github.com/cjdinger/sas-npp

SAS Innovate 2025: Call for Content! Submit your proposals before Sept 16. Accepted presenters get amazing perks to attend the conference!
Cuneyt
Obsidian | Level 7

I have written a syntax highlighting file (sas.lang) and a color theme file (sascolors.xml) for editing SAS programs in Gedit. They are both XML files. I have kept these files as simple as possible, first because I am not a professional software developer, and second because I wanted these files to be updated easily. I have attached a zip file that contains both of these files.

 

SAS.LANG: This is the SAS language specification file for syntax highlighting in Gedit. It highlights the following:

  1. Comments between /* */ and * ;
  2. String within single and double quotes
  3. SAS procedures
  4. SAS statements, keywords, options, etc.

This file should be saved in the following directory:
/.local/share/gtksourceview-3.0/language-specs/ or /.local/share/gtksourceview-4/language-specs/

 

SASCOLORS.XML: This is a Gedit color theme for the SAS language. This file should be saved in the following directory:
/.local/share/gedit/styles

It highlights the following

  1. Comments in green
  2. Strings in purple
  3. SAS procedures in dark blue and bold
  4. SAS statements, keywords, options, etc. in light blue

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 792 views
  • 2 likes
  • 2 in conversation