ProductPromotion
Logo

Elm

made by https://0x3d.site

GitHub - jcollard/elm-mode: Elm mode for emacs
Elm mode for emacs. Contribute to jcollard/elm-mode development by creating an account on GitHub.
Visit Site

GitHub - jcollard/elm-mode: Elm mode for emacs

GitHub - jcollard/elm-mode: Elm mode for emacs

Melpa Status Melpa Stable Status Build Status

elm-mode

Elm mode for Emacs.

Features

  1. Syntax highlighting.
  2. Intelligent indentation.
  3. Integration with elm-make
  4. Integration with elm-repl
  5. Integration with elm-reactor
  6. Integration with elm-package
  7. Integration with elm-format
  8. Integration with elm-test

Indentation

elm-mode indentation is based on cycling: every time you insert a new line there will be one or more indentation levels available for you to choose from. The exact number is printed in the minibuffer either as Sole indentation or Indent cycle (n)... where n is the number of available indentations to choose from. If the automatic indentation level was not the one you expected simply hit TAB to cycle through the list (note that hitting any other key will cancel the cycle).

Simpler indentation

There is also a simpler indentation mode, Elm Indent Simple which doesn't try to be as smart as the default one. The benefit of this mode is that it works a little more similarly to how more conventional editors handle indentation: indent one step forward by pressing TAB, one step backward with S-TAB.

It tries to be a little smart, however, and guess the easiest to determine indentation levels.

You can enable it by setting a variable, elm-mode-indent-mode to #'elm-indent-simple-mode, for example by doing this:

  (setq elm-mode-hook '(elm-indent-simple-mode))

Installation

This package requires Emacs 25.1 or later.

MELPA

You can install elm-mode from the package in MELPA. This is by far the most straightforward and recommended installation method.

From source

Add this repo to your load-path and (require 'elm-mode). Ensure that you have installed all the dependencies listed in the Package-Requires header of elm-mode.el.

Bindings

The following bindings are available in elm-mode:

TAGS

Keybinding Description
C-c M-t Generate a TAGS file for the current project.
M-. Jump to tag at point.
M-, Jump to previous location after visiting a tag.

TAGS file generation requires that the UNIX find, egrep commands and the Emacs etags command be available in your path.

Set or customize elm-tags-on-save to t to generate a new TAGS file for the current project on every save.

Set or customize elm-tags-exclude-elm-stuff to nil to include source files inside elm-stuff directories when generating the TAGS file.

elm-make

Keybinding Description
C-c C-c Compile the current buffer.
C-u C-c C-c Compile the current buffer, specifying the output file.
C-c M-c Compile the main elm file.
C-u C-c M-c Compile the main elm file, specifying the output file.
C-c C-a Add missing type annotations to the current buffer.
C-u C-c C-a Add missing type annotations to the current buffer, prompting before each change.
C-c C-r Clean up imports in the current buffer.
C-u C-c C-r Clean up imports in the current buffer, prompting before each change.

elm-repl

Keybinding Description
C-c C-l Load the current file in a REPL.
C-c C-p Push the current region to a REPL.
C-c C-e Push the current decl. to a REPL (requires haskell-mode).

elm-reactor

Keybinding Description
C-c C-n Preview the current buffer in a browser.
C-u C-c C-n Preview the current buffer in a browser in debug mode.
C-c C-m Preview the main elm file in a browser.
C-u C-c C-m Preview the main elm file in a browser in debug mode.

elm-package

Keybinding Description
C-c C-d View a function's documentation in a browser.
C-c C-i Import a module from one of the dependencies.
C-c C-s Sort the imports in the current file.
C-c M-k Open the package catalog.
C-u C-c M-k Open the package catalog, refreshing the package list first.

The following bindings are available in the package list buffer:

Keybinding Description
g Refresh package list.
n Next package.
p Previous package.
v View package in browser.
m Mark package for installation.
i Mark package for installation.
u Unmark package.
x Install marked packages.

Set or customize elm-sort-imports-on-save to t to apply elm-sort-imports on the current buffer on every save.

Completion for Elm >= 0.19

To obtain completion, code navigation and other niceties, use elm-language-server and an LSP package. eglot is a lightweight LSP front-end package for Emacs, and has built-in support for elm-language-server. Some users might prefer the rather larger and more opinionated lsp-mode.

elm-format

The following functionality requires elm-format to be installed. elm-format does not come with the Elm installer so you will have to install it manually.

Keybinding Description
C-c C-f Automatically format the current buffer.

Enable elm-format-on-save-mode to apply elm-format on the current buffer on every save. You might like to add it to your elm-mode-hook:

(add-hook 'elm-mode-hook 'elm-format-on-save-mode)

Alternatively, you can enable it on a per-project basis by including an entry like the following in your .dir-locals.el:

(elm-mode (mode . elm-format-on-save))

elm-test

The following functionality requires elm-test to be installed. elm-test does not come with the Elm installer so you will have to install it manually.

Keybinding Description
C-c C-v Run the test suite for the current project.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory