Small (not minimal) configuration to setup a working Elm environment leveraging the elm-language-server in Vim. It's using vim-plug as plugin manager and coc as a language client.
Requires vim
, elm
, elm-format
, elm-test
, and elm-language-server
to be installed globally by default.
git clone https://github.com/elm-tooling/elm-vim.git
cd elm-vim/vim-config-example
cp .vimrc ~
mkdir ~/.vim
cp coc-settings.json ~/.vim/
vim
Copy .vimrc
into the user $HOME
directory.
Or use vim -u .vimrc
instead to pass to path to the .vimrc
file.
Copy coc-settings.json
to $HOME/.vim/
(create directory if missing).
Opening vim
will download the plugins. Close with :q!<Enter>
.
Open an elm file e.g. vim Main.elm
- Format:
,p
- Hover:
,g
- Show usages:
,u
- Jump to definition:
,d
- Jump to error:
,a
- Solve error:
,s
- Rename variable:
,r
:CocInfo<Enter>
shows log messages:CocConfig<Enter>
opens coc configuration