# Do you use merlin with vim on Windows?

**URL:** <https://discuss.ocaml.org/t/do-you-use-merlin-with-vim-on-windows/6473>\
**Category:** Ecosystem\
**Created:** [September 22, 2020, 2:01pm UTC](https://discuss.ocaml.org/t/do-you-use-merlin-with-vim-on-windows/6473 "2020-09-22T14:01:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnWhitington](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/johnwhitington/32/1884_2.png) [@JohnWhitington](https://discuss.ocaml.org/u/JohnWhitington)\
**Post date:** [September 22, 2020, 2:01pm UTC](https://discuss.ocaml.org/t/do-you-use-merlin-with-vim-on-windows/6473/1 "2020-09-22T14:01:26Z")

</div>

Hello,

I’m writing a new “Up and Running with OCaml” page for [ocaml.org](http://ocaml.org), and I really want to make sure all the instructions work on Windows.

The only thing still eluding me is getting merlin working with Vim on the recommended fdopen Windows distribution:

> **[OCaml for Windows - OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/)**

I have been to the oracle, but they do not know:

> <https://github.com/ocaml/merlin/issues/1170>
>
> I'm working on new content for ocaml.org, on "Getting up and Running with OCaml", which includes editor support. One of our...

So, does anyone have a success report? Presently I am following the instructions printed when merlin is installed via opam. The ocamlmerlin executable is in the path. But :MerlinTypeOf, for example, just says “unknown command”. These instructions work fine for me on OS X and Linux.

I am using the vim installed by the cygwin installer, and running it from the OCaml64 window installed by the fdopen Windows OCaml Installer.

Thanks for any pointers.

---

<div class="post-metadata">

**Author:** ![Chimrod](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/chimrod/32/6042_2.png) [@Chimrod](https://discuss.ocaml.org/u/Chimrod)\
**Post date:** [September 23, 2020, 6:13am UTC](https://discuss.ocaml.org/t/do-you-use-merlin-with-vim-on-windows/6473/2 "2020-09-23T06:13:14Z")

</div>

Yes, I’m using merlin :

```auto
$ ocamlmerlin -version
The Merlin toolkit version v3.3.6-1-g70c8cff3-dirty, for Ocaml 4.10.0

```

You have to remember that merlin is installed as a window program, even if you are using cygwin : the path shall be given in the windows format.

This is an extract of my vimfile related to ocaml :

```auto
if has('gui_win32')
  let $PATH .= ";D:/bin/cygwin/usr/local/bin/"
  let $PATH .= ";".substitute(system('opam config var bin'),'\n$','','''')
  set pythonthreedll=python38.dll
  endif

  let s:opamshare = substitute(system('opam config var share'),'\n$','','''')

  if isdirectory(s:opamshare) && isdirectory(s:opamshare . "/merlin/")
  execute "set rtp+=" . s:opamshare . "/merlin/vim"
  endif

```

I’ve been annoyed this a bug which open hundred pop-ups when I save the editor. There is a [branch](https://github.com/ocaml/merlin/pull/1101) which correct this bug but has not been merge yet.

Note that I did not update my configuration to the last ocaml version, and can’t be sure that the whole toolchain still works.

---

<div class="post-metadata">

**Author:** ![JohnWhitington](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/johnwhitington/32/1884_2.png) [@JohnWhitington](https://discuss.ocaml.org/u/JohnWhitington)\
**Post date:** [September 23, 2020, 12:16pm UTC](https://discuss.ocaml.org/t/do-you-use-merlin-with-vim-on-windows/6473/3 "2020-09-23T12:16:53Z")

</div>

Thanks!

I have got to the bottom of this, with help from your instructions, and from the very useful “Troubleshooting” section here:

> **[ocaml/merlin](https://github.com/ocaml/merlin/wiki/vim-from-scratch)**
>
> Context sensitive completion for OCaml in Vim and Emacs - ocaml/merlin

The problem is that cygwin vim is not compiled with +python!

More info here: [https://superuser.com/questions/382430/building-vim-with-python-support-in-cygwin](https://superuser.com/questions/382430/building-vim-with-python-support-in-cygwin)
