English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] ocaml/vim/tags
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-12 (07:14)
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...>
Subject: Re: [Caml-list] ocaml/vim/tags

John Eikenberry writes:
 > Oh, and I found an example using etags and its regex... but I had little
 > luck with it either. Seems etags' regex features have changed quite a bit
 > since 1999/01.

I don't  know vim, but  I'm using the  following hack to get  tags for
Emacs using  etags, and it  still works nice  (of course it is  not as
satisfactory as tags based on a parsing of ocaml files)

	find . -name "*.ml*" | sort -r | xargs \
	etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/and[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/type[ \t]+\([^ \t]+\)/\1/" \
              "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/val[ \t]+\([^ \t]+\)/\1/" \
	      "--regex=/module[ \t]+\([^ \t]+\)/\1/"

The 'sort -r'  is used to have .mli entries  appearing first, then .ml
entries. Indeed, when looking for an identifier, you usually only want
its type declaration; if you also want its code, then use C-u M-.

Hope this helps,
Jean-Christophe Filliatre
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