Giter Club home page Giter Club logo

emacs-elixir's Introduction

License GPL 3 Build Status MELPA Stable MELPA

Elixir Mode

Provides font-locking, indentation and navigation support for the Elixir programming language.

Installation

Via package.el

package.el is the built-in package manager in Emacs.

elixir-mode is available on the two major community maintained repositories - MELPA STABLE and MELPA.

You can install elixir-mode with the following command:

M-x package-install [RET] elixir-mode [RET]

or by adding this bit of Emacs Lisp code to your Emacs initialization file (.emacs or init.el):

(unless (package-installed-p 'elixir-mode)
  (package-install 'elixir-mode))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents [RET]

Keep in mind that MELPA packages are built automatically from the master branch, meaning bugs might creep in there from time to time. Never-the-less, installing from MELPA is the recommended way of obtaining Elixir-Mode, as the master branch is normally quite stable and "stable" (tagged) builds are released somewhat infrequently.

With the most recent builds of Emacs, you can pin Elixir-Mode to always use MELPA Stable by adding this to your Emacs initialization:

(add-to-list 'package-pinned-packages '(elixir-mode . "melpa-stable") t)

Via el-get

el-get is another popular package manager for Emacs. If you're an el-get user just do M-x el-get-install [RET] elixir-mode [RET].

Manual

You can install Elixir-Mode manually by placing Elixir-Mode on your load-path and require ing it. Many people favour the folder ~/.emacs.d/vendor.

(add-to-list 'load-path "~/.emacs.d/vendor")
(require 'elixir-mode)

Usage

Interactive Commands

Command (For the M-x prompt.) Description
elixir-mode Switches to elixir-mode.
elixir-mode-opengithub Open the GitHub page for Elixir.
elixir-mode-open-elixir-home Go to Elixir README in the browser.
elixir-mode-open-docs-master Open the Elixir documentation for the master.
elixir-mode-open-docs-stable Open the Elixir documentation for the latest stable release.
elixir-mode-show-version Print version info for elixir-mode.

Configuration

Any file that matches the glob *.ex[s] or *.elixir is automatically opened in elixir-mode, but you can change this functionality easily.

;; Highlights *.elixir2 as well
(add-to-list 'auto-mode-alist '("\\.elixir2\\'" . elixir-mode))

Keymapping

Keymaps can be added to the elixir-mode-map variable.

Notes

If you want to use ruby-end-mode for a more comfortable editing experience, you can add the following to your elixir-mode-hook:

(add-to-list 'elixir-mode-hook
             (defun auto-activate-ruby-end-mode-for-elixir-mode ()
               (set (make-variable-buffer-local 'ruby-end-expand-keywords-before-re)
                    "\\(?:^\\|\\s-+\\)\\(?:do\\)")
               (set (make-variable-buffer-local 'ruby-end-check-statement-modifiers) nil)
               (ruby-end-mode +1)))

Also, if you use smartparens you can piggyback on some of its functionality for dealing with Ruby's do .. end blocks. A sample configuration would be:

(sp-with-modes '(elixir-mode)
  (sp-local-pair "fn" "end"
         :when '(("SPC" "RET"))
         :actions '(insert navigate))
  (sp-local-pair "do" "end"
         :when '(("SPC" "RET"))
         :post-handlers '(sp-ruby-def-post-handler)
         :actions '(insert navigate)))

Elixir Tooling Integration

If you looking for elixir tooling integration for Emacs, check: alchemist.el

You can use web-mode.el to edit elixir templates (eex files).

History

This mode is based on the Emacs mode by secondplanet.

Contributing

Please read CONTRIBUTING.md for guidelines on how to contribute to this project.

License

Copyright © 2011-2015 Samuel Tonini, Matt DeBoard, Andreas Fuchs, secondplanet and contributors.

Distributed under the GNU General Public License, version 3

emacs-elixir's People

Contributors

mattdeboard avatar tonini avatar antifuchs avatar syohex avatar sviridov avatar rranelli avatar gausby avatar edmz avatar tomterl avatar jesenko avatar rickhull avatar technomancy avatar pma avatar pragdave avatar andreas-roehler avatar carlosmn avatar jozip avatar artisonian avatar mbunkus avatar orb avatar rohitarondekar avatar scramblejams avatar fxbois avatar henrythebuilder avatar k1complete avatar

Watchers

none-p avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.