ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Super​Elixir

by edelvalle ST3 MacLinux

This is a sublime plug-in that provide IDE like capabilities to sublime when working with the Elixir language.

Details

Installs

  • Total 3K
  • Win 7
  • Mac 2K
  • Linux 956
Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

SuperElixir

This is a sublime plug-in that provide IDE like capabilities to sublime when working with the Elixir language. It does not include the syntax highlighting, please install the package Elixir

Donate for the cause

Features

  • Autocompletion
  • Go to definition
  • In-place documentation
  • Navigation through modules
  • Linting (Install SublimeLinter to use)

Installation

with Git

cd ~/.config/sublime-text-3/Packages/
git clone https://github.com/edelvalle/SuperElixir

with Sublime Package Control

  1. Open command pallet (default: ctrl+shift+p)
  2. Type package control install and select command Package Control: Install Package
  3. Type SuperElixir and select “SuperElixir”

Additional info installations you can find here http://wbond.net/sublime_packages/package_control/usage.

Configuration

Make sure you have at least Elixir 1.4.4 installed.

Elixir interpreter settings

By default this package will use default Elixir interpreter from the PATH. Also you can set different interpreter for each Sublime Project and the the mix environment will be set to MIX_ENV=dev. You can change this.

To set project related Elixir interpreter you have to edit yours project config file. By default project config name is <project name>.sublime-project

You can set Elixir interpreter and mix environment, using for example the following:

# <project name>.sublime-project
{
    // ...

    "settings": {
        // ...
        "elixir_interpreter": "~/elixir-2.4.4/bin/elixir",
        "mix_env": "test",
    }
}

Autocomplete on DOT

If you want auto-completion on dot, you can define a trigger in the Sublime User or Python preferences:

# User/Preferences.sublime-settings or User/Elixir.sublime-settings
{
    // ...
    "auto_complete_triggers": [{"selector": "source.elixir", "characters": "."}],
}

If you want auto-completion ONLY on dot and not while typing, you can set (additionally to the trigger above):

# User/Preferences.sublime-settings or User/Elixir.sublime-settings
{
    // ...
    "auto_complete_selector": "-",
}

Go to definition

Find function / variable / module definition / anything else.

Shortcut: CTRL+SHIFT+G

Mouse binding, was disabled, because sublime does not allows to set a scope so is active just in Elixir source files, and this can interfere with the global SublimeText configuration. But, if you want to use your mouse you can bind CTRL + LeftMouseButton:

# User/Default.sublime-mousemap
[
    {
        "modifiers": ["ctrl"], "button": "button1",
        "command": "super_elixir_goto",
        "press_command": "drag_select",
    }
]

Code navigation

As Elixir code is structured as a set of hierarchical modules this feature lists all loaded modules and allows you to select one of them an go to it.

Shortcut: CTRL+ALT+M

Show types and documentation

Just put your mouse on top of the term and you want documentation about. If it is a function it will list types first and then the documentation. It is not very pretty, we are working on it.

Special thanks

  • Elixir Sense: provides the Elixir introspection capabilities.
  • PyErlang: allows the plug-in to talk to Elixir Sense.
  • Sublime Jedi: provides the Python to do the go to definition in Sublime.
  • Elixir Linting: provides most of the code for linting.
  • Sublime Elixir: provides some helper functions to put all together.

Room for improvement

  • How documentation is shown. Right now is just shown in plain text and is kind of ugly, I think we should use a markdown renderer for Sublime like Sublime Markdown Pop-ups.
  • Improve the linting, so it just does not work on safe but in real-time typing.
  • When sublime includes scopes in mouse map maybe we can have Ctrl-Click to go to definitions.
  • Support Windows. Right now the communication with Elixir Sense is over Unix sockets; and Windows can't do that. But.. who writes Elixir in Windows any way? :trollface: