From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1036F7F20C for ; Sun, 17 Feb 2013 19:37:36 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of david@grayskies.net) identity=pra; client-ip=209.85.220.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="david@grayskies.net"; x-sender="david@grayskies.net"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of david@grayskies.net) identity=mailfrom; client-ip=209.85.220.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="david@grayskies.net"; x-sender="david@grayskies.net"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vc0-f172.google.com) identity=helo; client-ip=209.85.220.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="david@grayskies.net"; x-sender="postmaster@mail-vc0-f172.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloCAAEjIVHRVdysm2dsb2JhbABFhkmnZZFvfxYOAQEBAQEICQsJFCeCHwEBBAEjSwsFCwsOCgICCRoDAgIhEwEFAQoBARAGEwgKh24DCQYMoFmLY4dbAwqJWoEjizaCKzMHgi0yYQOIZ4tqgniEVIVSgzM/hEg X-IPAS-Result: AloCAAEjIVHRVdysm2dsb2JhbABFhkmnZZFvfxYOAQEBAQEICQsJFCeCHwEBBAEjSwsFCwsOCgICCRoDAgIhEwEFAQoBARAGEwgKh24DCQYMoFmLY4dbAwqJWoEjizaCKzMHgi0yYQOIZ4tqgniEVIVSgzM/hEg X-IronPort-AV: E=Sophos;i="4.84,682,1355094000"; d="scan'208";a="2492692" Received: from mail-vc0-f172.google.com ([209.85.220.172]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Feb 2013 19:37:08 +0100 Received: by mail-vc0-f172.google.com with SMTP id l6so3183964vcl.17 for ; Sun, 17 Feb 2013 10:37:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:message-id:in-reply-to:references :subject:x-mailer:mime-version:content-type :content-transfer-encoding:content-disposition:x-gm-message-state; bh=jz7LGQvBSIEEPHzcEaTpBN07J0QLkotEsOueZBJJQ6E=; b=Q1R7NcSPkayasNLZDHx3WxdsUKZWjbcTPC4gdCRIxx/MsN8+JN4tIrDj//PR5bLjVx ChD3Whcb4m0Tij7EWiSSD/DoPNJUnHHptj+58wCfagliuDNxSO+sOLdC8B8NumiZGIfC NVLQEpjnuHt17TsdDujausVHHz1KrcMgbjHJFW9Ka5apdtF0O/cW+w8uJprocir7ZvrA IOUG4odbzVPb7PKQLO3FKO1C2EzZ6R+S+YJwGESK3X18tk1zbu86sAvP7OCRhIITvG3n jhrcVl0vSs2T0of+BKWnFNkyfEOK5HTnHlpUeZ/iZnFmmNNsYnLqADdzYbLPadBn/p1W qoBQ== X-Received: by 10.220.151.141 with SMTP id c13mr12338371vcw.64.1361126226908; Sun, 17 Feb 2013 10:37:06 -0800 (PST) Received: from [10.0.1.6] (207-237-93-39.c3-0.nyw-ubr1.nyr-nyw.ny.cable.rcn.com. [207.237.93.39]) by mx.google.com with ESMTPS id u5sm91807634vef.0.2013.02.17.10.37.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 Feb 2013 10:37:05 -0800 (PST) Date: Sun, 17 Feb 2013 13:37:48 -0500 From: David Powers To: Raphael Proust Cc: Niki Yoshiuchi , caml-list@inria.fr Message-ID: <4DDE2B89DE10452FB01251C852E29C2B@grayskies.net> In-Reply-To: References: <201302081625.29881.louis.gesbert@ocamlpro.com> <201302151457.30892.louis.gesbert@ocamlpro.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Gm-Message-State: ALoCoQlxw46Ao6f+Fcg4EyBkSFy5f4yjFIYpzaEtf91Z8WbqRVGv6NtzjONVBYnaDVN6QjWw7ZHP Subject: Re: [Caml-list] ocp-indent 1.0.0 release A nice binding might be something like=20=20 nnoremap =3D=3D gg=3DG'' which will rebind the normal =3D=3D (which isn't that useful here) to reinv= ent the whole file and return he cursor to the line and column it was on. -David=20=20 On Sunday, February 17, 2013 at 1:05 PM, Raphael Proust wrote: > On Sat, Feb 16, 2013 at 8:34 PM, Niki Yoshiuchi wrote: > > 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. > >=20=20 > > 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 co= de. > > In other words, while writing code I'll end up with something like this > > (dots represent spaces): > >=20=20 > > let my_fun f =3D > > . . . . let nested_fun g =3D > > . . . . . . . . (* content *) > >=20=20 > > However if I then select the text and and hit "=3D" it re-indents it us= ing two > > spaces per nesting level. >=20=20 >=20=20 >=20=20 > This is not a bug in either vim nor ocp-indent. It is a bug in your > configurations (they are not in sync). You can either setup ocp-indent > to use 4 spaces or vim to use 2. See `ocp-indent --config help` for > the former, and `:h tabstop` and `:h softtabstop` for the latter. >=20=20 > >=20=20 > > The second thing I've noticed is that "=3D" indents only relative to the > > selected text. In other words, if I have > >=20=20 > >=20=20 > > let my_fun f =3D > > . . let nested_fun g =3D > > . . . . (* content *) > > . . . . (* more content *) > >=20=20 > > and I hit "=3D" while the cursor is on the third line I end up with: > >=20=20 > > let my_fun f =3D > > . . let nested_fun g =3D > > (* content *) > > . . . . (* more content *) > >=20=20 > > Doing something like "ggVG=3D" will properly indent the text. >=20=20 > This is the expected behaviour. ocp-indent is only given the selected > text and thus can only work correctly when receiving complete blocks. > (Indentation is relative to the first line of the chunk that is > passed.) >=20=20 > You can pass a full paragraph using `=3Dap` ("ap" stands for "a > paragraph", see `:h ap` for help). You can also use blocks. For more > information on these, see `:h text-objects`. >=20=20 > Note that you can do `gg=3DG` (move, action, move) instead of `ggvG=3D` > (move, mode, move, action). It is only marginally shorter but, more > importantly, it will preserve your `'<` and `'>` marks (see, `:h '>` > for more explanations). (And dually, you can replace `=3Dap` (action, > object) by `vap=3D` (mode, object, action).) >=20=20 > >=20=20 > > Thanks for the great work on making OCaml more usable! My code has never > > looked cleaner. > >=20=20 > > -Niki Yoshiuchi > >=20=20 > >=20=20 > > On Fri, Feb 15, 2013 at 8:57 AM, Louis Gesbert > > wrote: > > >=20=20 > > > Thanks for all the feedback and few bug reports during the past week = of > > > beta- > > > test. > > >=20=20 > > > We can now announce the 1.0.0 release of ocp-indent, available on opa= m. > > >=20=20 > > > Enjoy! > > >=20=20 > > > -- > > > Louis, OCamlPro > > >=20=20 > > > Le vendredi 8 f=C3=A9vrier 2013 16:25:29, Louis Gesbert a =C3=A9crit : > > > > OCamlPro is proud to announce the beta-release of ocp-indent. > > > >=20=20 > > > > 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' tuar= eg > > > > mode, or be run from vim. > > > >=20=20 > > > > You can try it now with: > > > >=20=20 > > > > $ opam install ocp-indent > > > >=20=20 > > > > $ INSTDIR=3D"$(opam config var prefix)/share/typerex/ocp-indent" > > > >=20=20 > > > > $ echo '(load-file "'"$INSTDIR/ocp-indent.el"'")' >>~/.emacs > > > >=20=20 > > > > $ echo 'autocmd FileType ocaml source '"$INSTDIR"'/ocp-indent.vim' > > > > > > ~/.vimrc > > > > >=20=20 > > > >=20=20 > > > >=20=20 > > > >=20=20 > > > >=20=20 > > > > Or check it out at https://github.com/OCamlPro/ocp-indent > > > >=20=20 > > > >=20=20 > > > >=20=20 > > > > It presents many improvements over the tuareg indentation engine, a= much > > > > better understanding of the syntax, linear complexity, specific han= dling > > > > for many cases. Also, it was intentionally provided with much less > > > > customisation options. > > > >=20=20 > > > > Feel free to submit any code snippet that is not indented to your t= aste, > > > > to > > > > help us improve ocp-indent further. > > > >=20=20 > > > >=20=20 > > > > 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 > > > >=20=20 > > > >=20=20 > > > > -- > > > > Louis Gesbert, OCamlPro > > >=20=20 > > >=20=20 > > >=20=20 > > > -- > > > 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 > >=20=20 >=20=20 >=20=20 >=20=20 >=20=20 >=20=20 > --=20=20 > ______________ > Rapha=C3=ABl Proust >=20=20 > --=20=20 > 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