If you are looking to work with Elm in Vim you should definitely check out:
It appears that ElmCast/elm-vim is no longer being updated and does not support Elm 0.19. This fork has been updated for Elm 0.19 and includes some other changes. No major development is planned at the moment but we do plan to keep up with necessary changes and merge requests are welcome. Changes so far:
gf
binding to handle prefixed function calls and module aliases. It also attempts to take you to the line of the function in question though that is behaviour normally associated with C-]
. It might be moved at some point.elm-format
in the project root so it can detect the elm version appropriately.Check out this ElmCast video for more detail.
If you don't have a preferred installation method, I recommend installing vim-plug, and then simply add Plug 'elmcast/elm-vim'
to your plugin section:
NOTE: If you are using vim-polyglot, you need to disable its default elm plugin by adding let g:polyglot_disabled = ['elm']
to your config file.
First, make sure you have the Elm Platform installed. The simplest method to get started is to use the official npm package.
In order to run unit tests from within vim, install elm-test
For code completion and doc lookups, install elm-oracle.
npm install -g elm-oracle
To automatically format your code, install elm-format.
npm install -g elm-format
The plugin provides several <Plug>
mappings which can be used to create custom mappings. The following keybindings are provided by default:
You can disable these mappings if you want to use your own.
let g:elm_setup_keybindings = 0
The preferred linter to use with elm-vim is Ale. It should work out of the box.
Syntastic support should work out of the box, but we recommend the following settings:
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:elm_syntastic_show_warnings = 1
let g:ycm_semantic_triggers = { \ 'elm' : ['.'], \}
call neocomplete#util#set_default_dictionary( \ 'g:neocomplete#sources#omni#input_patterns', \ 'elm', \ '\.')
let g:elm_jump_to_error = 0 let g:elm_make_output_file = "elm.js" let g:elm_make_show_warnings = 0 let g:elm_syntastic_show_warnings = 0 let g:elm_browser_command = "" let g:elm_detailed_complete = 0 let g:elm_format_autosave = 1 let g:elm_format_fail_silently = 0 let g:elm_setup_keybindings = 1
:ElmMake [filename]
calls elm-make
with the given file. If no file is given it uses the current file being edited.
:ElmMakeMain
attempts to call elm-make
with "Main.elm".
:ElmTest
calls elm-test
with the given file. If no file is given it runs it in the root of your project.
:ElmRepl
runs elm-repl
, which will return to vim on exiting.
:ElmErrorDetail
shows the detail of the current error in the quickfix window.
:ElmShowDocs
queries elm-oracle, then echoes the type and docs for the word under the cursor.
:ElmBrowseDocs
queries elm-oracle, then opens docs web page for the word under the cursor.
:ElmFormat
formats the current buffer with elm-format.
Copyright © Joseph Hager. See LICENSE
for more details.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4