diff --git a/modules/lang/elixir/README.org b/modules/lang/elixir/README.org index b1a703e2f..5301cba0d 100644 --- a/modules/lang/elixir/README.org +++ b/modules/lang/elixir/README.org @@ -13,6 +13,8 @@ - [[#gentoo-linux][Gentoo Linux]] - [[#opensuse][openSUSE]] - [[#features][Features]] +- [[#appendix][Appendix]] + - [[#commands][Commands]] * Description This module provides support for [[https://elixir-lang.org/][Elixir programming language]] via [[https://github.com/tonini/alchemist.el][alchemist.el]] @@ -25,6 +27,7 @@ or [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]]. + [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]] + [[https://github.com/tonini/alchemist.el][alchemist.el]] + [[https://github.com/aaronjensen/flycheck-credo][flycheck-credo]] ++ [[https://github.com/ananthakumaran/exunit.el][exunit]] * Prerequisites You should have Elixir installed, for example, via your distribution's package @@ -60,3 +63,16 @@ sudo zypper install elixir - Phoenix support - ~iex~ integration (~:tools eval~) - Syntax checking (~:checkers syntax~, using [[https://github.com/aaronjensen/flycheck-credo][flycheck-credo]]~) +* 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 | diff --git a/modules/lang/elixir/config.el b/modules/lang/elixir/config.el index 34bb0abc9..98745c859 100644 --- a/modules/lang/elixir/config.el +++ b/modules/lang/elixir/config.el @@ -71,3 +71,17 @@ (let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company))))) (remove-hook 'alchemist-mode-hook fn) (remove-hook 'alchemist-iex-mode-hook fn))) + +(use-package! exunit + :hook (elixir-mode . exunit-mode) + :init + (map! :after elixir-mode + :localleader + :map elixir-mode-map + :prefix "t" + "a" #'exunit-verify-all + "r" #'exunit-rerun + "v" #'exunit-verify + "T" #'exunit-toggle-file-and-test + "t" #'exunit-toggle-file-and-test-other-window + "s" #'exunit-verify-single)) diff --git a/modules/lang/elixir/packages.el b/modules/lang/elixir/packages.el index b4d091bf3..6fc03b62b 100644 --- a/modules/lang/elixir/packages.el +++ b/modules/lang/elixir/packages.el @@ -4,5 +4,6 @@ ;; +elixir.el (package! elixir-mode :pin "01b332495d3f44addeb236428041c4ffa0c2ca3b") (package! alchemist :pin "6f99367511ae209f8fe2c990779764bbb4ccb6ed") +(package! exunit :pin "c77b0397b80d772c98fcc34c9ab131a8350fbf40") (when (featurep! :checkers syntax) (package! flycheck-credo :pin "e88f11ead53805c361ec7706e44c3dfee1daa19f"))