I am trying to get autocomplete for OCaml. I like to use Vim and I found this plugin:
https://github.com/the-lambda-church/merlin
I installed it using OPAM and added the necessary lines to load it into my .vimrc
I made sure that the OPAM bin folder (which contains ocamlmerlin) is in my .profile file and verified that I can access it from the terminal, and for vim I printed out the PATH variable using "Ctrl-r = $ PATH", and it shows that it contains the OPAM bin folder.
This still does not work, I do not know what else needs to be done to make it work. I get syntax highlighting, but it's still without merlin. I want autocomplete to work.
If I press Ctrl-N to display a completion sentence, I get a “normal” vim completion, which is basically a list of words mentioned in the document.
Checking the startup log file, I see that Vim was actually loading merlin:
chdir(/home/incraved/.opam/system/share/ocamlmerlin/vim/plugin)
fchdir() to previous dir
sourcing "/home/incraved/.opam/system/share/ocamlmerlin/vim/plugin/merlin.vim"
finished sourcing /home/incraved/.opam/system/share/ocamlmerlin/vim/plugin/merlin.vim
Searching for "/home/incraved/.opam/system/share/ocamlmerlin/vimbufsync/plugin/**/*.vim"
Any ideas?
source
share