Git Product home page Git Product logo

inf-elixir's Introduction

inf-elixir

License GPL 3 MELPA MELPA Stable CircleCI status

This is a package to allow you to pop open and interact with Elixir REPL (IEx, presently).

Features

  • Run IEx normally (inf-elixir)
  • Run IEx in a project setting (inf-elixir-project)
  • Ability to send commands to the inf buffer from a code file (inf-elixir-send-line, inf-elixir-send-region, inf-elixir-send-buffer)

TODO

  • Got a feature you want to see? Open an issue! ๐Ÿ˜„

Installation

inf-elixir is proudly distributed by MELPA and MELPA Stable. I would also strongly encourage folks to use MELPA Stable, as the releases there will be more, well, stable. In order to install the package, follow the Getting Started instructions on the MELPA website or the Getting Started instructions on the MELPA Stable website.

Once your installation is configured to use MELPA, inf-elixir can be installed with M-x package-install RET inf-elixir RET.

use-package can be used to install and/or configure inf-elixir:

(use-package inf-elixir
  :bind (("C-c i i" . 'inf-elixir)
         ("C-c i p" . 'inf-elixir-project)
         ("C-c i l" . 'inf-elixir-send-line)
         ("C-c i r" . 'inf-elixir-send-region)
         ("C-c i b" . 'inf-elixir-send-buffer)
         ("C-c i R" . 'inf-elixir-reload-module)))

Or with Doom Emacs:

packages.el

(package! inf-elixir)

config.el

(map! :after elixir-mode
        :localleader
        :map elixir-mode-map
        :prefix ("i" . "inf-elixir")
        "i" 'inf-elixir
        "p" 'inf-elixir-project
        "l" 'inf-elixir-send-line
        "r" 'inf-elixir-send-region
        "b" 'inf-elixir-send-buffer
        "R" 'inf-elixir-reload-module)

Keybindings

inf-elixir intentionally ships with no keybindings by default. This grants the user the freedom to specify whatever keybindings they would like. Functions that users would probably have an interest in binding are:

  • inf-elixir :: Starts an IEx shell in a new buffer, or switches to an existing IEx shell buffer.
  • inf-elixir-project :: Starts an IEx shell in the context of the project (by default by passing the -S mix argument to iex), or switches to an existing IEx shell buffer.
  • inf-elixir-send-line :: Send the current line to the IEx shell buffer as input.
  • inf-elixir-send-region :: Send the selected region to the IEx shell buffer as input.
  • inf-elixir-send-buffer :: Send the entire current buffer to the IEx shell as input.
  • inf-elixir-reload-module :: Reload modules from current buffer using IEx.Helpers.r/1.

An example of keybindings is included in the use-package declaration above.

Development

I am not yet using any kind of build tool (like Eldev or Cask) to develop this plugin. Generally speaking, working with the code involves:

  1. Clone the git repository
  2. Make some changes
  3. Load your changes with M-x load-file RET inf-elixir.el RET
  4. Verify your changes worked
  5. Send a PR ๐Ÿ™

There are some tests written with ERT that can be run with this command:

$ emacs -batch -l ert -l inf-elixir.el -l tests/inf-elixir-test.el -f ert-run-tests-batch-and-exit

inf-elixir's People

Contributors

j3rn avatar illia-danko avatar nickboyadjian avatar akirak avatar matgomes avatar syohex 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.