caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Vim6 and O'Caml.
@ 2001-10-06  5:52 Jeremy Fincher
  2001-10-06  8:21 ` Stefano Zacchiroli
  2001-10-06 10:53 ` Markus Mottl
  0 siblings, 2 replies; 3+ messages in thread
From: Jeremy Fincher @ 2001-10-06  5:52 UTC (permalink / raw)
  To: caml-list

I've recently installed vim6, and would like to possibly return to vim after 
a
long period of time using emacs for my coding.  The main reason I switched 
to
emacs is because the indentation worked better (more naturally, requiring me 
to
press tab less often) and because I can run an ocaml toplevel as a 
subprocess in
emacs (which has kept me from troubleshooting an annoying terminal issue I'm
having.)

I've tried the new vim6 indent files, but it doesn't seem to apply the same
rules that emacs applies, which I'm both accustomed to, and which almost all 
the
source code I've seen is writte in.  Surely all the source code I've seen
written hasn't been written in emacs, so I assume there's some way to make 
vim
indent code like emacs does.  Does anyone know how to do so?

Thanks,
Jeremy


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Vim6 and O'Caml.
  2001-10-06  5:52 [Caml-list] Vim6 and O'Caml Jeremy Fincher
@ 2001-10-06  8:21 ` Stefano Zacchiroli
  2001-10-06 10:53 ` Markus Mottl
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Zacchiroli @ 2001-10-06  8:21 UTC (permalink / raw)
  To: caml-list

On Sat, Oct 06, 2001 at 01:52:30AM -0400, Jeremy Fincher wrote:
> I've tried the new vim6 indent files, but it doesn't seem to apply the same
> rules that emacs applies, which I'm both accustomed to, and which almost all 
> 
> the
> source code I've seen is writte in.  Surely all the source code I've seen
> written hasn't been written in emacs, so I assume there's some way to make 
> vim
> indent code like emacs does.  Does anyone know how to do so?

Have you tried the ocaml indent file for vim by Marcus Mottl that you
can find at the url:

   http://www.ai.univie.ac.at/~markus/vim/indent/ocaml.vim
?

Probabily this is integrated in the new vim 6.0 release but I'm not
sure.

-- 
Stefano "Zack" Zacchiroli <zack@cs.unibo.it> ICQ# 33538863
Home Page: http://www.cs.unibo.it/~zacchiro
Undergraduate student of Computer Science @ University of Bologna, Italy
                 - Information wants to be Open -
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Vim6 and O'Caml.
  2001-10-06  5:52 [Caml-list] Vim6 and O'Caml Jeremy Fincher
  2001-10-06  8:21 ` Stefano Zacchiroli
@ 2001-10-06 10:53 ` Markus Mottl
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Mottl @ 2001-10-06 10:53 UTC (permalink / raw)
  To: Jeremy Fincher; +Cc: caml-list

On Sat, 06 Oct 2001, Jeremy Fincher wrote:
> I've tried the new vim6 indent files, but it doesn't seem to apply
> the same rules that emacs applies, which I'm both accustomed to, and
> which almost all the source code I've seen is writte in.

It actually isn't capable of correctly indenting OCaml-code. The reason
is simple: you'd need a complete parser and pretty-printer to do so. This
is an awful lot of work and slows down some operations considerably.

Currently, the indent file for OCaml does an approximate job: it
only considers the current and the last line to compute a suitable
shiftwidth. This works remarkably well in the majority of cases.

> Surely all the source code I've seen written hasn't been written
> in emacs, so I assume there's some way to make vim indent code like
> emacs does.  Does anyone know how to do so?

You can also program Vim (though not in Lisp). Considering the richness
of builtin functions in Emacs and the still large amount of Lisp-code
required to implement automatic indentation (~ 1500 LOCS), I wouldn't
dare to do the same for Vim. Anybody want to give it a go? ;)

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-06 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-06  5:52 [Caml-list] Vim6 and O'Caml Jeremy Fincher
2001-10-06  8:21 ` Stefano Zacchiroli
2001-10-06 10:53 ` Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).