Syntax highlighting for desktop configuration files



I was wondering if anyone had any intention to write a package with support for syntax highlighting of desktop configuration files (file extensions: .desktop and .directory). Both GNU Emacs and Vim currently have syntax-highlighting support for these files.

Thanks for your time,


.desktop config files use the INI format. Use this package:
( you will have to manually change the syntax highlighting to INI in the bottom right corner of atom though. The package doesn’t specifiy .desktop or .directory to be recognized automatically)


Atom now supports custom file type associations, so you could associate .desktop or .directory with the INI file syntax.


And how would I do that? I read your link but that link assumed I knew which file I had to add the required changes to, which I do not.


That goes into the config.cson, which you can open with the “Open Your Config” command in the Command Palette.


@leedohm Ah, I just tried adding:

      'source.ini': [

to my config.cson script and it didn’t cause my .desktop files to be highlighted with the INI syntax. That was what I was supposed to do right, to get my .desktop files highlighted using the language-ini package?


What if you drop the * and just do '.desktop' or drop both * and . and use just desktop?


Not sure who of you created the accepted pull request, but for your info: .desktop and .directory are now in the INI package by default.


adjusting '*.desktop' to 'desktop' and doing the same with '*.directory', worked, thanks.


I’ve also tried to get XML syntax highlighting for .menu files and it isn’t working, this is the case I have in config.cson (including the INI code too, in case it is relevant):

      'source.ini': [
      'source.xml': [


The scope for XML is not source.xml but text.xml: