Using merlin in vim for coq plugin development in ocaml

416 Views Asked by At

I installed Coq with opam and want to make a Coq plugin. I managed to compile some plugin examples using coq_makefile, but it would be great if I could use merlin in vim for type information and completion for Coq libraries.

Is there a way in which I can add the Coq libraries to ocamlfind?

3

There are 3 best solutions below

0
On BEST ANSWER

coq_makefile will now generate a .merlin for you. Just type

make .merlin
0
On

I could not figure out how to properly use coq_makefile to do this and @Nico Lehmann answer didn't work for me.

My .merlin file is:

FLG -rectypes
S /usr/lib/coq/**
B /usr/lib/coq/**

where the first line is important(I have no clue what it means). Of course, change /usr/lib/ to the path where your coq is. You can find the coq location by running coqc -where in the command line.

0
On

Finally I answered myself. It was onlly necesary to put the directories of the cmi files of coq in the .merlin file with the directive B

B path/to/coq/kernel
B path/to/coq/library
...