Skip to content
This repository has been archived by the owner. It is now read-only.
Elixir linter for Sublime Text 3 based on SublimeLinter
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

NOTE: This repository is no longer maintained, as I've switched to a far-superior way of linting by using JakeBecker's elixir-ls and tom564's LSP. Be sure to check it out yourself.


Build Status

This linter plugin for SublimeLinter provides an interface to check elixir syntax using elixirc. It will be used with files that have the “elixir” syntax.


SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions here.

Linter installation

Before installing this plugin, you must ensure that elixir (>= 1.0) is installed on your system. For instructions on how to install elixir, please refer to the elixir-lang docs.

Linter configuration

In order for elixir to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in “Finding a linter executable” through “Validating your PATH” in the documentation.

Once elixir is installed and configured, you can proceed to install the SublimeLinter-contrib-elixirc plugin if it is not yet installed.

Plugin installation

Please use Package Control to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here.

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.

  2. When the plugin list appears, type elixirc. Among the entries you should see SublimeLinter-contrib-elixirc. If that entry is not highlighted, use the keyboard or mouse to select it.


For general information on how SublimeLinter works with settings, please see Settings. For information on generic linter settings, please see Linter Settings.

In addition to the standard SublimeLinter settings, SublimeLinter-contrib-elixirc provides its own settings.

Setting Description
pa (list) dirs for -pa option
require (list) dirs/files to require
mix_project (bool) use mix for linting
chdir (string) run linter from the specified dir
prepend (list) will be prepended to the linter command
append (list) will be appended to the linter command

In a mix project:

  • set chdir to your mix project's root directory.
  • set mix_project to true


In your .sublime-project file:

   "SublimeLinter": {
      "linters": {
         "elixirc": {
            "mix_project": true,
            "chdir": "PROJECT_ROOT"


  • PROJECT_ROOT is the path to the root your project (use ${project} if your sublime project is saved there)

Note: Currently, exs files within a mix project (e.g. ExUnit tests) are linted for syntax errors only. This is a known issue and will be resolved in a future version.

If you also use an elixir version manager, set prepend as per the example below

Outside a mix project:

  • if a file uses macros, the beam output paths must be added to code path through pa
  • files (or directories) to require prior to linting must be added through require. They are required in the given order. Directories, if given, are traversed recursively and alphabetically.


In your .sublime-project file:

   "SublimeLinter": {
      "linters": {
         "elixirc": {
            "pa": ["PROJECT_ROOT/_build/dev/lib/PROJECT_WITH_MACROS/ebin"],
            "require": ["PROJECT_ROOT/deps/DEP1"]


  • PROJECT_ROOT is the path to the root of your project (use ${project} if your sublime project is saved there)
  • PROJECT_WITH_MACROS is the project name which contains the macros. List all projects in pa
  • DEP1 is a directory with files to require. If needed, list specific files first.

Command customization

The prepend and append options allow you to modify the executed command.

A typical use-case for this would be if you use elixir version managers (e.g. kiex), which alter certain environment variables when switching between different versions of elixir.

Since sublime is very limited in terms of user-configurable environment variables, the problem could be solved with the env command on any typical UNIX-based OS.


   "SublimeLinter": {
      "linters": {
        "elixirc": {
          "chdir": "/Users/foo/projects/myapp",
          "mix_project": true,
          "prepend": ["/usr/bin/env", "MIX_ARCHIVES=/Users/foo/.kiex/mix/archives/elixir-1.3.3"]


If you would like to contribute enhancements or fixes, please do the following:

  1. Fork the plugin repository.
  2. Hack on a separate topic branch created from the latest master.
  3. Commit and push the topic branch.
  4. Make a pull request.
  5. Be patient. ;-)

Please note that modifications should follow these coding guidelines:

  • Indent is 4 spaces.
  • Code should pass flake8 and pep257 linters.
  • Vertical whitespace helps readability, don’t be afraid to use it.
  • Please use descriptive variable names, no abbreviations unless they are very well known.

Thank you for helping out!

You can’t perform that action at this time.