All Projects → ocaml → Merlin

ocaml / Merlin

Licence: mit
Context sensitive completion for OCaml in Vim and Emacs

Programming Languages

ocaml
1615 projects

Projects that are alternatives of or similar to Merlin

Dracula Theme
🧛🏻‍♂️ One theme. All platforms.
Stars: ✭ 17,480 (+1252.94%)
Mutual labels:  atom, emacs
Themecreator
https://mswift42.github.io/themecreator/ create themes for intellij, textmate, atom, emacs, vim and gnome terminal.
Stars: ✭ 303 (-76.55%)
Mutual labels:  atom, emacs
Import Js
A tool to simplify importing JS modules
Stars: ✭ 511 (-60.45%)
Mutual labels:  atom, emacs
An Old Hope Syntax Atom
⚛️ Atom theme inspired by a galaxy far far away...
Stars: ✭ 82 (-93.65%)
Mutual labels:  atom
Emacs Chocolate Theme
🍫A dark chocolatey theme for Emacs 🍫
Stars: ✭ 83 (-93.58%)
Mutual labels:  emacs
Emacs Oob Reboot
A project to revitalize Emacs by providing core-friendly changes for an improved out-of-the-box experience
Stars: ✭ 85 (-93.42%)
Mutual labels:  emacs
Ox Jira.el
Org-mode export backend for JIRA markup
Stars: ✭ 88 (-93.19%)
Mutual labels:  emacs
Clj Suitable
ClojureScript "IntelliSense" support for JS objects and their properties/methods. Via figwheel and Emacs CIDER.
Stars: ✭ 82 (-93.65%)
Mutual labels:  emacs
Quark Emacs
🚀 An incredible wonderland of code
Stars: ✭ 86 (-93.34%)
Mutual labels:  emacs
Makem.sh
Makefile-like script for building and testing Emacs Lisp packages
Stars: ✭ 85 (-93.42%)
Mutual labels:  emacs
Emacsideas
Porting some great extensions of emacs to Intellij IDEA. such as AceJump, CopyWithoutSelection.
Stars: ✭ 84 (-93.5%)
Mutual labels:  emacs
.emacs.d
Centaur Emacs - A Fancy and Fast Emacs Configuration
Stars: ✭ 1,251 (-3.17%)
Mutual labels:  emacs
Atom Supercollider
SuperCollider development environment for Atom.io
Stars: ✭ 85 (-93.42%)
Mutual labels:  atom
Beginend
Emacs package to redefine M-< and M-> for some modes
Stars: ✭ 82 (-93.65%)
Mutual labels:  emacs
Atom Linter Alex
Linter plugin using alex to catch insensitive, inconsiderate writing
Stars: ✭ 87 (-93.27%)
Mutual labels:  atom
Tide
Tide - TypeScript Interactive Development Environment for Emacs
Stars: ✭ 1,238 (-4.18%)
Mutual labels:  emacs
Treemacs
Stars: ✭ 1,270 (-1.7%)
Mutual labels:  emacs
Dumb Jump
an Emacs "jump to definition" package for 50+ languages
Stars: ✭ 1,256 (-2.79%)
Mutual labels:  emacs
Fmacs
Emacs clone in Forth.
Stars: ✭ 84 (-93.5%)
Mutual labels:  emacs
Vterm Toggle
toggles between the vterm buffer and whatever buffer you are editing.
Stars: ✭ 85 (-93.42%)
Mutual labels:  emacs

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. To get editor support with Merlin in other editors, see this.

Easy installation with Opam

If you have a working Opam installation, install Merlin running the following two commands in terminal:

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

Since version 4.0, merlin's repository has a dedicated branch per version of OCaml, and the branch name consist of the concatenation of OCaml major version and minor version. So, for instance, OCaml 4.11.* maps to branch 411. The main branch is usually synchronized with the branch compatible with the latest (almost-)released version of OCaml.

Note: if you're using an older version of OCaml (between 4.02 and 4.10) you will want to build the 3.4 branch, although it won't contain the most recent features.

Compilation

Dependencies: ocamlfind, yojson >= 1.6.0, dune >= 2.7.

dune build -p dot-merlin-reader,merlin

Note: if you want to work on merlin, you'll want to avoid the -p merlin, to build in dev mode, with some extra warnings enabled. In that case you'll also need an extra dependency: menhir.

Installation

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

dune install -p dot-merlin-reader,merlin

You can pass an explicit prefix to dune, using --prefix. It defaults to your current opam switch.

Editor setup

To set up 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:

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

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

Merlin only supports Vim and Emacs out-of-the-box. This section describes shortly how to get merlin-based editor support in other editors.

Visual Studio Code

OCaml has official support for Visual Studio Code through an extension called OCaml Platform available in the Visual Studio Marketplace. Project source is available here. Note that it requires OCaml-LSP, an official Language Server Protocol(LSP) implementation for OCaml based on merlin. It can be installed by running opam install ocaml-lsp-server.

Editors without official support

Consider using OCaml-LSP along with your editor's plugin for LSP if there is one.

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 what is happening (editor is freezing, you got an error message, the answer is not what was expected, ...)
  • include the content of error messages if there are any.

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:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].