Skip to content
Vim plugin for the Elm programming language
Branch: master
Clone or download
Latest commit 04df290 Aug 15, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc rename help file Apr 20, 2015
ftplugin remove deprecated code Apr 6, 2015
LICENSE Merge remote-tracking branch 'upstream/master' Apr 20, 2015


Vim plugin for the Elm programming language.


Just like any other plugin, clone this repository into the ~/.vim/bundle directory

cd ~/.vim/bundle && \
git clone

If you are unfamiliar with this process, please refer to the Pathogen project.

System Requirements

Nothing other than vim is needed for the syntax highlighting.

For the special commands and aliases (for compilation, etc), the plugin expects the following programs to be available:

  • elm-make: The Elm build tool.
  • elm-repl: The Elm REPL. The plugin sends it bits of code for evaluation.


These are the available commands. To get the most out of them, you should create mappings according to your needs.


  • :ElmMakeCurrentFile compiles the current file.
  • :ElmMakeMain compiles an assumed Main.elm file.
  • :ElmMakeFile <filename> compiles filename.


  • :ElmEvalLine evaluates the current line and puts the result as a comment in a new line below it.
  • :ElmEvalSelection evaluates a visual mode selection.


  • :ElmRepl switches to elm-repl, when closing the REPL you'll get back to vim.

Example mappings

I use the following mappings in my .vimrc at the moment:

nnoremap <leader>el :ElmEvalLine<CR>
vnoremap <leader>es :<C-u>ElmEvalSelection<CR>
nnoremap <leader>em :ElmMakeCurrentFile<CR>

Example autocommands

Vim autocommands can make your life a lot easier. These are just some examples of what I use sometimes:

  • Compiling the current file on write:
    • :au BufWritePost *.elm ElmMakeCurrentFile
  • Usually more useful: Compiling a specific file, e.g. "Main.elm", on file write to any file in the project:
    • :au BufWritePost *.elm ElmMakeFile("Main.elm")

Remember you can clear all these afterwards, with e.g. :au! BufWritePost *.elm


  • Integration with Elm docs.
You can’t perform that action at this time.