I've started using this with vim and I've noticed a few things.  I'm not sure if it's by design or if they are bugs.

First, I have vim setup to use 4 spaces for indentation.  When editing an OCaml file, it continues to respect the 4 space indent while writing code.  In other words, while writing code I'll end up with something like this (dots represent spaces):

let my_fun f =
. . . . let nested_fun g =
. . . . . . . . (* content *)

However if I then select the text and and hit "=" it re-indents it using two spaces per nesting level.

The second thing I've noticed is that "=" indents only relative to the selected text.  In other words, if I have


let my_fun f =
. . let nested_fun g =
. . . . (* content *)
. . . . (* more content *)

and I hit "=" while the cursor is on the third line I end up with:

let my_fun f =
. . let nested_fun g =
(* content *)
. . . . (* more content *)

Doing something like "ggVG=" will properly indent the text.

Thanks for the great work on making OCaml more usable!  My code has never looked cleaner.

-Niki Yoshiuchi

On Fri, Feb 15, 2013 at 8:57 AM, Louis Gesbert <louis.gesbert@ocamlpro.com> wrote:
Thanks for all the feedback and few bug reports during the past  week of beta-
test.

We can now announce the 1.0.0 release of ocp-indent, available on opam.

Enjoy!

--
Louis, OCamlPro

Le vendredi 8 février 2013 16:25:29, Louis Gesbert a écrit :
> OCamlPro is proud to announce the beta-release of ocp-indent.
>
> Ocp-indent is a simple tool, entirely written in OCaml, which sole purpose
> is to indent OCaml code. It can plug-in seamlessly into emacs' tuareg
> mode, or be run from vim.
>
> You can try it now with:
>
> $ opam install ocp-indent
>
> $ INSTDIR="$(opam config var prefix)/share/typerex/ocp-indent"
>
> $ echo '(load-file "'"$INSTDIR/ocp-indent.el"'")' >>~/.emacs
>
> $ echo 'autocmd FileType ocaml source '"$INSTDIR"'/ocp-indent.vim'
> >>~/.vimrc
>
>
> Or check it out at https://github.com/OCamlPro/ocp-indent
>
>
>
> It presents many improvements over the tuareg indentation engine, a much
> better understanding of the syntax, linear complexity, specific handling
> for many cases. Also, it was intentionally provided with much less
> customisation options.
>
> Feel free to submit any code snippet that is not indented to your taste, to
> help us improve ocp-indent further.
>
>
> Some comparison with tuareg on a few big OCaml projects can be seen at
> http://htmlpreview.github.com/?https://github.com/AltGr/ocp-indent-
> tests/blob/master/status.html
>
>
> --
> Louis Gesbert, OCamlPro

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs