How to install this Syntax highlighting package for Ansible files?


I’m trying to install this package for highlighting Syntax of Ansible files.

I tried to follow the installation instruction but they seem to be outdated and no longer work for the current version of Atom.

My goal is to have the same syntax highting as you can see on the link I provided.

I tried all syntax highlighting options that Atom provides but unfortunately none of them suites me. I even tried to install “language-Ansible” package but it is also not highlighting syntax the way I need.

You can convert TextMate packages into Atom packages using the apm init. Since most Sublime Text grammars are based onTextMate packages themselves, you can convert the project in a few steps. You just need to make sure the package use the same file structure as Sublime Text.

# Clone package
git clone

# Adjust package to TextMate file-structure
cd sublime-ansible
mkdir Syntaxes
mv *.tmLanguage *.tmPreferences Syntaxes
cd ..

# Convert package with apm
apm init --package language-sublime-ansible --convert sublime-ansible

It turns out, that Atom reports an error once installing the package. Looks like renaming the scope in syntax/comments.cson to scopeName fixes this.

Take note I have named the package language-sublime-ansible as an example. You can use any name, but be aware that it shouldn’t clash with an existing package. Unfortunately, the apm currently have no interested in supporting org-scoped packages as know from npm.

Thank you.

First I tried to install it without renaming the scope in ~/language-sublime-ansible/grammars/comments.cson then after I run apm install language-sublime-ansible it answered with the following error: Request for package information failed: Not Found

Then I tried to rename the scope in ~/language-sublime-ansible/grammars/comments.cson

name: “Comments”
scope: “scopeName”
shellVariables: [
value: "# "

after I tried to run apm install language-sublime-ansible again. Unfortunately no luck. Same error.

Not sure what I’m missing. Any ideas?

I figure it out. I just moved the package to .atom/packages and renamed scope to scopeName. It worked.


For some reason the syntax highlighting is still not what can be seen on the picture here:

Is it possible that Syntax Theme option has something to do with it? I tried all the Syntax Theme options provided by Atom but no luck. Syntax still use different colors. Is there something else that could effect it?