2019-06-24 19:55:27 +03:00
#+TITLE : lang/elixir
#+DATE : June 24, 2019
#+SINCE : v2.0.9
* Table of Contents :TOC_3:noexport:
- [[#description ][Description ]]
2019-07-26 22:14:07 +03:00
- [[#module-flags ][Module flags ]]
2019-07-26 21:23:32 +03:00
- [[#plugins ][Plugins ]]
2019-06-24 19:55:27 +03:00
- [[#prerequisites ][Prerequisites ]]
2019-07-26 21:23:32 +03:00
- [[#install-elixir ][Install Elixir ]]
2019-06-24 19:55:27 +03:00
- [[#with-asdf ][With ~asdf~ ]]
- [[#arch-linux ][Arch Linux ]]
- [[#gentoo-linux ][Gentoo Linux ]]
2019-08-27 10:50:37 +02:00
- [[#opensuse ][openSUSE ]]
2019-06-24 19:55:27 +03:00
- [[#features ][Features ]]
2020-10-22 18:39:59 -06:00
- [[#appendix ][Appendix ]]
- [[#commands ][Commands ]]
2019-06-24 19:55:27 +03:00
* Description
2019-07-26 21:23:32 +03:00
This module provides support for [[https://elixir-lang.org/ ][Elixir programming language ]] via [[https://github.com/tonini/alchemist.el ][alchemist.el ]]
2020-05-11 11:17:23 -06:00
or [[https://github.com/elixir-lsp/elixir-ls/ ][elixir-ls ]].
2019-07-26 21:23:32 +03:00
2019-07-26 22:14:07 +03:00
** Module flags
2020-05-11 11:17:23 -06:00
+ ~+lsp~ Enable LSP support. Requires [[https://github.com/elixir-lsp/elixir-ls/ ][elixir-ls ]].
2019-07-26 22:14:07 +03:00
2019-07-26 21:23:32 +03:00
** Plugins
2019-12-13 22:53:19 +02:00
+ [[https://github.com/elixir-editors/emacs-elixir ][elixir-mode ]]
2019-07-26 21:23:32 +03:00
+ [[https://github.com/tonini/alchemist.el ][alchemist.el ]]
+ [[https://github.com/aaronjensen/flycheck-credo ][flycheck-credo ]]
2019-06-24 19:55:27 +03:00
* Prerequisites
2019-07-26 21:23:32 +03:00
You should have Elixir installed, for example, via your distribution's package
2019-06-24 19:55:27 +03:00
manager or a version management tool such as [[https://github.com/asdf-vm/asdf-elixir ][asdf ]].
2019-07-26 21:23:32 +03:00
If you want to add support for LSP ([[modules/tools/lsp ][:tools lsp ]]), be sure to install [[https://github.com/JakeBecker/elixir-ls/ ][elixir-ls ]]
and enable ~:tools lsp~ in your ~init.el~ .
2020-01-14 03:04:26 -05:00
To support linting with [[https://github.com/rrrene/credo ][credo ]], add ~:checkers syntax~ to your ~init.el~
2019-07-26 21:23:32 +03:00
** Install Elixir
2019-06-24 19:55:27 +03:00
*** With ~asdf~
#+BEGIN_SRC sh
asdf plugin-add elixir
2019-07-26 21:23:32 +03:00
asdf install elixir 1.9.1
2019-06-24 19:55:27 +03:00
#+END_SRC
*** Arch Linux
#+BEGIN_SRC sh :dir /sudo::
sudo pacman -S elixir
#+END_SRC
*** Gentoo Linux
#+BEGIN_SRC sh :dir /sudo::
sudo emerge -v dev-lang/elixir
#+END_SRC
2019-08-27 10:50:37 +02:00
*** openSUSE
#+BEGIN_SRC sh :dir /sudo::
sudo zypper install elixir
#+END_SRC
2019-07-26 21:23:32 +03:00
* Features
- Code completion (~:completion company~ )
- Documentation lookup (~:tools lookup~ )
- Mix integration
- Phoenix support
- ~iex~ integration (~:tools eval~ )
2020-01-14 03:04:26 -05:00
- Syntax checking (~:checkers syntax~ , using [[https://github.com/aaronjensen/flycheck-credo ][flycheck-credo ]]~)
2020-10-22 18:39:59 -06:00
* Appendix
** Commands
*** exunit-mode
The exunit-mode prefix is =SPC m t= . Here is some examples:
| | | |
| command | key / ex command | description |
|------------------------------------------+------------------+--------------------------------------------------------|
| ~exunit-verify-all~ | =SPC m t a= | Runs exunit on all files |
| ~exunit-rerun~ | =SPC m t r= | Re-runs last exunit command |
| ~exunit-verify~ | =SPC m t v= | Runs exunit on current file |
| ~exunit-verify-single~ | =SPC m t s= | Runs exunit for the item on cursor |
| ~exunit-toggle-file-and-test~ | =SPC m t t= | Switch between implementation and test |
| ~exunit-toggle-file-and-test-other-window~ | =SPC m t T= | Switch between implementation and test in other window |