> ## Content Index
> Fetch the complete content index at: https://blog.amosti.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# Associate file endings with languages in Atom
- URL: https://blog.amosti.net/associate-file-endings-with-languages-in-atom/
- Published: 2017-07-01T07:14:06.000Z
- Updated: 2018-03-13T12:31:04.000Z
- Author: Andreas Mosti
- Tags: #Import 2026-11-20 06:35

A short tip if you use [Atom](https://atom.io/?ref=blog.amosti.net) as your preferred editor: how to associate file endings with a specific language pack for syntax highlighting. Should be easy right? Well, I actually had to do some googling on this.

When working with my [Ansible](https://github.com/ansible/ansible?ref=blog.amosti.net) codebase, I like to use Atom. As with most languages out there, the community has created a [language pack for it](https://atom.io/packages/language-ansible?ref=blog.amosti.net) to give you some syntax highlighting goodness. There is just one detail missing here: How do I associate my file endings with the Ansible language pack?

For my inventory files, I postfix them with `.inventory` for convenience. All the servers for, let's say Team A, goes in `TeamA.inventory`. The language pack for Ansible doesn't know this, so I need to tell it som how. Right out of the box there is actually no easy way to do this, but thankfully the Atom ecosystem also got this covered with the `file-types` package.

`apm install file-types` and then edit the local `config.cson` file like so:

```
"*":
  "file-types":
      ".*/group_vars/.*": "source.ansible"
      ".*/host_vars/.*": "source.ansible"
      inventory: "source.ansible"

```

And we are good to go.

Update: As of version `1.24.1` of Atom we don't need any extension for setting language-pack to basic file-endings.  
This can be done with:

```
"*":
  core:
    customFileTypes:
      "source.ansible": [
        "inventory"
      ]

```