Skip to content
Vim tooling for working with Elm
Vim script
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vim-config-example
README.md Readme: Link example Aug 31, 2019

README.md

elm-vim

Instructions to get started with Elm tooling in Vim.

Language Server

elm-language-server provides most features, e.g. diagnostics (elm make), linting (elm-analyse), jump to definition, formatting (elm-format) and more. It is a standalone implementation of the language server protocol (LSP).

Usage with ale

Install ale and use elm_ls linter. See elm-language-server README, ale README and ale docs for usage instructions.

Usage with Coc.nvim

Install Coc. Look into elm-language-server README or Coc wiki for setup and usage instructions.

Syntax highlighting

Install elm-vim-syntax. It'll provide syntax highlighting and indentation.

Code formatting

Code formatting (elm-format) is part of elm-language-server. An alternative is ale's elm-format fixer.

Snippets

Install Ultisnips for snippet functionality. Install honza/vim-snippets which contains elm.snippets

Or use snippets of elm-language-server (e.g. with Coc).

Tests

Install vim-test. It contains elmtest.vim. :TestFile will execute elm-test.

Tagbar

Install majutsushi/tagbar and configure content displayed in the tagbar.

let g:tagbar_type_elm = {
      \ 'kinds' : [
      \ 'f:function:0:0',
      \ 'm:modules:0:0',
      \ 'i:imports:1:0',
      \ 't:types:1:0',
      \ 'a:type aliases:0:0',
      \ 'c:type constructors:0:0',
      \ 'p:ports:0:0',
      \ 's:functions:0:0',
      \ ]
      \}

Configuration examples

There is an example configuration to showcase a small Vim setup for Elm.

User configurations

You can’t perform that action at this time.