2022-03-28 15:03:21 +02:00
#+title : :lang elixir
#+subtitle : Erlang done right
#+created : May 24, 2017
#+since : 2.0.3 (#83)
2021-10-16 01:28:32 +02:00
* Description :unfold:
2023-03-22 17:03:12 -04:00
This module provides support for [[https://elixir-lang.org/ ][Elixir programming language ]] via [[https://github.com/elixir-lsp/elixir-ls/ ][elixir-ls ]].
2021-10-16 01:28:32 +02:00
** Maintainers
/This module has no dedicated maintainers./ [[doom-contrib-maintainer: ][Become a maintainer? ]]
2019-07-26 21:23:32 +03:00
2019-07-26 22:14:07 +03:00
** Module flags
2021-10-16 01:28:32 +02:00
- +lsp ::
2022-09-26 02:19:42 +08:00
Enable LSP support for ~elixir-mode~ . Requires [[doom-module::tools lsp ]] and a langserver
2021-10-16 01:28:32 +02:00
(supports [[https://github.com/elixir-lsp/elixir-ls/ ][elixir-ls ]]).
2022-04-09 18:38:04 +03:00
- +tree-sitter ::
Leverages tree-sitter for better syntax highlighting and structural text
2022-09-26 02:19:42 +08:00
editing. Requires [[doom-module::tools tree-sitter ]].
2021-10-16 01:28:32 +02:00
** Packages
2022-09-26 02:19:42 +08:00
- [[doom-package:elixir-mode ]]
- [[doom-package:exunit ]]
- [[doom-package:flycheck-credo ]] if [[doom-module::checkers syntax ]]
2021-10-16 01:28:32 +02:00
** Hacks
/No hacks documented for this module./
2019-07-26 22:14:07 +03:00
2021-10-16 01:28:32 +02:00
** TODO Changelog
# This section will be machine generated. Don't edit it by hand.
/This module does not have a changelog yet./
2019-06-24 19:55:27 +03:00
2021-10-16 01:28:32 +02:00
* Installation
[[id:01cffea4-3329-45e2-a892-95a384ab2338 ][Enable this module in your ~doom!~ block. ]]
2019-07-26 21:23:32 +03:00
2021-10-16 01:28:32 +02:00
This module requires Elixir. Install it via your distribution's package manager
or a version management tool such as [[https://github.com/asdf-vm/asdf-elixir ][asdf ]].
2022-09-26 02:19:42 +08:00
To add LSP support, install [[https://github.com/JakeBecker/elixir-ls/ ][elixir-ls ]] and enable [[doom-module::tools lsp ]].
2021-10-16 01:28:32 +02:00
To support linting with [[https://github.com/rrrene/credo ][credo ]], add ~:checkers syntax~ to ~$DOOMDIR/init.el~ .
2019-07-26 21:23:32 +03:00
** Install Elixir
2021-10-16 01:28:32 +02:00
(See [[https://elixir-lang.org/install.html ]] for other operating systems)
2019-06-24 19:55:27 +03:00
*** With ~asdf~
2021-10-16 01:28:32 +02:00
#+begin_src sh
2019-06-24 19:55:27 +03:00
asdf plugin-add elixir
2019-07-26 21:23:32 +03:00
asdf install elixir 1.9.1
2021-10-16 01:28:32 +02:00
#+end_src
2019-06-24 19:55:27 +03:00
*** Arch Linux
2021-10-16 01:28:32 +02:00
#+begin_src sh
pacman -S elixir
#+end_src
2019-06-24 19:55:27 +03:00
*** Gentoo Linux
2021-10-16 01:28:32 +02:00
#+begin_src sh
emerge -v dev-lang/elixir
#+end_src
2019-08-27 10:50:37 +02:00
*** openSUSE
2021-10-16 01:28:32 +02:00
#+begin_src sh
zypper install elixir
#+end_src
* TODO Usage
#+begin_quote
2023-09-16 20:19:11 +02:00
/This module's usage documentation is incomplete./ [[doom-contrib-module: ][Complete it? ]]
2021-10-16 01:28:32 +02:00
#+end_quote
2022-09-26 02:19:42 +08:00
- Code completion ([[doom-module::completion company ]])
- Documentation lookup ([[doom-module::tools lookup ]])
2019-07-26 21:23:32 +03:00
- Mix integration
- Phoenix support
2022-09-26 02:19:42 +08:00
- ~iex~ integration ([[doom-module::tools eval ]])
- Syntax checking ([[doom-module::checkers syntax ]], using [[doom-package:flycheck-credo ]])
2022-10-05 12:36:59 +01:00
- Formatting for elixir files provided by [[doom-module::editor format ]].
2021-10-16 01:28:32 +02:00
** exunit-mode
The exunit-mode prefix is [[kbd: ][<localleader> t ]]. Here is some examples:
| command | key / ex command | description |
|--------------------------------------------+-------------------+--------------------------------------------------------|
| ~exunit-verify-all~ | [[kbd:][<localleader> t a]] | Runs exunit on all files |
| ~exunit-rerun~ | [[kbd:][<localleader> t r]] | Re-runs last exunit command |
| ~exunit-verify~ | [[kbd:][<localleader> t v]] | Runs exunit on current file |
| ~exunit-verify-single~ | [[kbd:][<localleader> t s]] | Runs exunit for the item on cursor |
| ~exunit-toggle-file-and-test~ | [[kbd:][<localleader> t t]] | Switch between implementation and test |
| ~exunit-toggle-file-and-test-other-window~ | [[kbd:][<localleader> t T]] | Switch between implementation and test in other window |
* TODO Configuration
#+begin_quote
2023-09-16 20:19:11 +02:00
This module has no configuration documentation yet. [[doom-contrib-module: ][Write some? ]]
2021-10-16 01:28:32 +02:00
#+end_quote
* Troubleshooting
/There are no known problems with this module./ [[doom-report: ][Report one? ]]
* Frequently asked questions
/This module has no FAQs yet./ [[doom-suggest-faq: ][Ask one? ]]
* TODO Appendix
#+begin_quote
2023-09-16 20:19:11 +02:00
This module has no appendix yet. [[doom-contrib-module: ][Write one? ]]
2021-10-16 01:28:32 +02:00
#+end_quote