[ANN] vim-ocaml - new home

I don’t know which instructions you are referring to (by the way, beware that this doc is outdated), but firstly, a more correct path would be ~/.opam/default/share/ocp-indent/vim/syntax/ocp-indent.vim, with the package’s name under the share directory. Secondly, a Vim file named syntax/ocp-indent.vim usually means «the syntax highlighting for the language named “ocp-indent”». That’s probably not what you want.

For ocp-indent and Merlin installed via opam, I simply have the following in my vimrc file:

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

" plugin “ocp-indent” (indenting tool):
execute 'set rtp^=' . g:opamshare . '/ocp-indent/vim'
" plugin “merlin” (IDE for OCaml):
execute 'set rtp^=' . g:opamshare . '/merlin/vim'

No need for auto-commands, the loading mechanism of Vim will do the right thing based on file names.

1 Like