Closed Karmaki closed 9 years ago
1.5.1 vastly improved the vim indent script; it's also now installed to share/ocp-indent/vim/indent/ocaml.vim
, rather than share/vim/syntax/ocp-indent.vim
, which should make it auto-loadable by vim for indenting ocaml files.
The editor configuration can now be done automatically by opam-user-setup
: please try opam user-setup install
(it's transparent on the changes it makes, and can be easily reverted).
(on opam < 1.2.2, you may need to run opam install user-setup
first)
I tried what you said, but it appears that the problem comes from my version of vim
that doesn't know the systemlist
function which was introduced in 7.4:248 (see also http://stackoverflow.com/questions/32658499/ocaml-vim-user-setup-does-not-work/32658731#32658731). My version is 7.4:52, which is the one that comes with Ubuntu 14.04 (trusty) which is the last LTS version.
I think that I managed to fix the problems what the following modifications:
1- In the .vimrc
part (generated by opam-user-setup
):
if exists("*systemlist")
let s:opam_available_tools = systemlist(join(s:opam_check_cmdline, ' '))
else
let s:opam_available_tools = split(system(join(s:opam_check_cmdline, ' ')))
endif
2- In the ocaml.vim
file:
if exists("*systemlist")
let s:indents = systemlist(cmdline, getline('1','$'))
else
let s:indents = split(system(cmdline, join (getline('1','$'), "\n")))
endif
Ah, thanks a lot, that's very useful feedback! I'll update opam-user-setup for compat.
I have been using opt-indent for a long time in vim, and it is great! But today, in a new opam installation, I wanted to install opt-indent again which came in version 1.5.1, and gives the message:
So I did that instead of the previous setting which was:
The problem is that it is not working anymore, I mean, when I do
==
on a line, it does nothing at all.I also tried to source
opam/root/4.02.1/share/ocp-indent/vim/indent/ocaml.vim
, but it didn't change anything :-( Did I miss something ?1.5.0 do the same thing. Going back to 1.4.2.