A major mode for editing Alan files. It provides:
- Syntax highlighting.
- Display the current context (path) at point.
- Automatic indentation.
- Flycheck integration.
- Simple xref backend.
- Put alan-mode.el in your load-path.
- Install it from
using package-install M-x package-install [ret] alan-mode
To setup up FlyCheck add the following snippet to your init.
(add-hook 'alan-mode-hook
(lambda ()
(flycheck-mode +1)
))
When in an empty Alan block (e.g. { }
) a newline yields the following result:
{
|}
In most cases this is more useful:
{
|
}
Alan mode provides an electric layout rule (alan-add-line-in-braces-rule
). Set it up in your init file, preferably in the alan-mode-hook
.
(electric-layout-mode 1)
(set (make-variable-buffer-local 'electric-layout-rules) (list alan-add-line-in-braces-rule))