npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@esy-ocaml/merlin

v3.0.5005

Published

Makes sure that ocamlmerlin binary can be found in PATH.

Downloads

1,047

Readme

merlin completion in vim

Merlin is an editor service that provides modern IDE features for OCaml.

Emacs and Vim support is provided out-of-the-box. External contributors added support for Visual Studio Code, Sublime Text and Atom.

Easy installation with Opam

If you have a working Opam installation, Merlin is only two commands away:

opam install merlin
opam user-setup install

opam-user-setup takes care of configuring Emacs and Vim to make best use of your current install.

You can also configure the editor yourself, if you prefer.

Manually building and installing Merlin

Compilation

Dependencies: ocaml >= 4.02.3, ocamlfind, yojson.

./configure
 make

The configure script will check that all the dependencies are met, and will allow you to choose where to install Merlin.

Installation

If you haven't encountered any errors in the previous step, just run:

$ make install 

Installation directory is determined by the prefix selected by configure. It defaults to /usr/local.

Editor setup

To setup Emacs and Vim, you need to instruct them to run the appropriate script when an OCaml file is opened.

In the rest of the document, <SHARE_DIR> refers to the directory where Merlin data files are installed.

It will usually be:

  • "/usr/local/share" if you used manual configuration Merlin
  • "<prefix>/share" if you explicitly specified a prefix when configuring Merlin
  • printed by the command opam config var share, if you used opam

Vim setup

Makes sure that ocamlmerlin binary can be found in PATH.

The only setup needed is to have the following directory in vim runtime path (append this to your .vimrc):

:set rtp+=<SHARE_DIR>/merlin/vim

The default configuration can be seen in:

<SHARE_DIR>/merlin/vim/plugin/merlin.vim

After adding merlin to vim runtime path, you will probably want to run :helptags <SHARE_DIR>/merlin/vim/doc to register Merlin documentation inside vim.

A more comprehensive documentation can be found on the vim-from-scratch wiki.

Emacs setup

Merlin comes with an emacs library (file: emacs/merlin.el) that implements a minor-mode that is supposed to be used on top of tuareg-mode.

All you need to do is add the following to your .emacs:

(push "<SHARE_DIR>/emacs/site-lisp" load-path) ; directory containing merlin.el
(setq merlin-command "<BIN_DIR>/ocamlmerlin")  ; needed only if ocamlmerlin not already in your PATH
(autoload 'merlin-mode "merlin" "Merlin mode" t)
(add-hook 'tuareg-mode-hook 'merlin-mode)
(add-hook 'caml-mode-hook 'merlin-mode)

merlin-mode will make use of auto-complete-mode (available by package.el and the MELPA repository) if it is installed.

A more comprehensive documentation can be found on the emacs-from-scratch wiki.

Other editors

The wiki also contains pages for:

External contributors have implemented modes for more editors:

Next steps

To use Merlin with a multi-file project, it is necessary to have a .merlin file.

Read more in the wiki to learn how to make full use of Merlin in your projects.

Development of Merlin

Most of the development happens through the github page.

The mailing list welcomes general questions and discussions.

Merlin Labels

Area/Emacs: Related to Emacs

Area/Vim: Related to Vim

Kind/Bug: This issue describes a problem

Kind/Docs: This issue describes a documentation change

Kind/Feature-Request: Solving this issue requires implementing a new feature

Kind/To-discuss: Discussion needed to converge on a solution; often aesthetic. See mailing list for discussion

Status/0-More-info-needed: More information is needed before this issue can be triaged

Status/0-Triage: This issue needs triaging

Status/1-Acknowledged: This issue has been triaged and is being investigated

Status/2-Regression: Known workaround to be applied and tested

Status/3-Fixed-need-test: This issue has been fixed and needs checking

Status/4-Fixed: This issue has been fixed!

Status/5-Awaiting-feedback: This issue requires feedback on a previous fix

You can see current areas of development in our Merlin Project Roadmaps that we keep up to date.

Contributing to Merlin

Merlin needs your help and contributions!

Reporting Issues

When you encounter an issue, please report it with as much detail as possible. A thorough bug report is always appreciated :)

Check that our issue database doesn't already include that problem/suggestion. You can click "subscribe" on issues to follow their progress and updates.

When reporting issues, please include:

  • steps to reproduce the problem, if possible with some code triggering the issue,
  • version of the tools you are using: operating system, editor, OCaml.

Try to be as specific as possible:

  • avoid generic phrasing such as "doesn't work", explain why it is not working (editor is freezing, you got an error message, the answer is not what was expected, ...)
  • include the content of error messages.

If it seems relevant, also include information about your development environment:

  • the Opam version and switch in use,
  • other toolchains involved (OCaml flavors, cygwin, C compiler, shell, ...),
  • how the editor was setup.

Pull Requests

Found a bug and know how to fix it? Or have a feature you can implement directly? We appreciate pull requests to improve Merlin, and any significant fix should start life as an issue first.

Documentation and wiki

Help is greatly appreciated, the wiki needs love.

If the wiki didn't cover a topic and you found out the answer, updating the page or pointing out the issue will be very useful for future users.

Discussing with other Merlin users and contributors

Together with commenting on issues with direct feedback and relevant information, we use the mailing list to discuss ideas and current designs/implementations. User input helps us to converge on solutions, especially those for aesthetic and user-oriented topics.

List of Contributors

We would like to thank all people who contributed to Merlin.

Main collaborators:

Contributors:

Sponsoring and donations

We would like to thank Jane Street for sponsoring and OCaml Labs for providing support and management.

And many thanks to our Bountysource backers.

Other acknowledgements

Distribution and configuration:

Support for other editors: