sponsor Vim development Vim logo Vim Book Ad

ocaml.annot.pl : Displays OCaml type annotations

 script karma  Rating 9/5, Downloaded by 1514  Comments, bugs, improvements  Vim wiki

created by
David Baelde
 
script type
utility
 
description
When editing a OCaml file for which annotations have been compiled, press <F3> and get a message with the type of the value under the cursor.

I didn't want to use the python code from original ocaml.vim in omlet.vim (script_id=1196), so I wrote this tiny hack using an external perl script -- no need for feature "perl". I only print out the first line, because I found no convenient way to print everything without having the message bar to grow big, mess the screen and have a prompt... To be continued.
 
install details
Add this to your .vimrc, supposing you put ocaml.annot.pl in you ~/.vim/scripts:

autocmd FileType omlet nmap <F3> :exec 'echomsg (system("~/.vim/scripts/ocaml.annot.pl' bufname('%') (line2byte(line('.'))+col('.')-1) '"))'<RETURN>
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ocaml.annot.pl 0.2 2010-09-19 7.0 David Baelde Update from John Alfred Nathanael Chee: print multi-line types, and slightly tighter parsing of the annot file.
ocaml.annot.pl 0.1 2005-02-02 6.0 David Baelde Initial upload
ip used for rating: 18.97.9.171

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github