# Elm autocomplete with Vim?

**URL:** <https://discourse.elm-lang.org/t/elm-autocomplete-with-vim/8562>\
**Category:** Learn\
**Created:** [August 9, 2022, 2:05pm UTC](https://discourse.elm-lang.org/t/elm-autocomplete-with-vim/8562 "2022-08-09T14:05:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AvailableUsername](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@AvailableUsername](https://discourse.elm-lang.org/u/AvailableUsername)\
**Post date:** [August 9, 2022, 2:05pm UTC](https://discourse.elm-lang.org/t/elm-autocomplete-with-vim/8562/1 "2022-08-09T14:05:45Z")

</div>

Hello,

I’m using Vim with ALE. Syntax highlighting works. Errors highlighting works, so it is clear that ALE is able to communicate with the language server.  
However, I can’t find a way to get autocomplete to work.

Say I have a model such as

```auto
type alias Model =
    { speed: Float
    , username: String
    }

```

Before Vim I used to use Atom. When using a variable that had type Model, I was be able to write

```auto
model.

```

then I’d be suggested `speed` or `username`.  
But it doesn’t work in Vim with ALE. Even when typing “Ctrl + n” to trigger the autocomplete, I’m basically suggested all the words that have been typed in the source file. I guess this is the default behavior for autocomplete in Vim. But I’d like to have autocomplete specifically for Elm, just like in Atom.  
Is that possible ?

---

<div class="post-metadata">

**Author:** ![AvailableUsername](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@AvailableUsername](https://discourse.elm-lang.org/u/AvailableUsername)\
**Post date:** [August 9, 2022, 2:37pm UTC](https://discourse.elm-lang.org/t/elm-autocomplete-with-vim/8562/2 "2022-08-09T14:37:03Z")

</div>

Replying to my own question. The problem stemmed from an incompatibility between the version of nodejs on my system and the elm language server. The nodejs version installed was 18, it didn’t work with that version of nodejs. I installed nodejs version 16 instead and now the autocompletion is working as it should, and I even have the function definitions, that I was missing as well.

cf [Error on elm-language-server attach due to node 16 and higher · Issue #692 · elm-tooling/elm-language-server · GitHub](https://github.com/elm-tooling/elm-language-server/issues/692)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [August 19, 2022, 2:37pm UTC](https://discourse.elm-lang.org/t/elm-autocomplete-with-vim/8562/3 "2022-08-19T14:37:53Z")

</div>

Closed on August 19, 2022, 2:37pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
