Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 178 lines (126 sloc) 5.921 kB
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
1 ![merlin completion in vim](https://github.com/the-lambda-church/merlin/wiki/vim_complete.png)
8997cc8 @trefis readme: added screenshots
trefis authored
2
8a08f6a @trefis README: clean up.
trefis authored
3 Building and installing Merlin
4 ==============================
5
6 This README gives only indications on how to install merlin from source.
7 If you want know how to install it from opam, and how to setup your environment
8 to use merlin, have a look at [the wiki](https://github.com/def-lkb/merlin/wiki).
1bcb132 @def-lkb Updated readme
def-lkb authored
9
10 Compilation
11 -----------
12
4d3de13 @def-lkb Remove ocamlbuild files
def-lkb authored
13 Dependencies: ocaml >= 4.00.1, ocamlfind, yojson
1bcb132 @def-lkb Updated readme
def-lkb authored
14
2895fdd @def-lkb Update README.md
def-lkb authored
15 $ ./configure
5340e02 @trefis format readme (minor commit)
trefis authored
16 $ make
1bcb132 @def-lkb Updated readme
def-lkb authored
17
8a08f6a @trefis README: clean up.
trefis authored
18 The configure script will check that all the dependencies are met, and will
19 allow you to choose where to install merlin.
1bcb132 @def-lkb Updated readme
def-lkb authored
20
21 Installation
22 ------------
23
8a08f6a @trefis README: clean up.
trefis authored
24 If you haven't encountered any error in the previous step, just run:
1bcb132 @def-lkb Updated readme
def-lkb authored
25
5340e02 @trefis format readme (minor commit)
trefis authored
26 $ make install
1bcb132 @def-lkb Updated readme
def-lkb authored
27
4b89a86 @def-lkb Add information for compilling from git
def-lkb authored
28
e86f8c8 @def-lkb [#65] Starting cleanup documentation…
def-lkb authored
29 Share directory, \<SHARE\_DIR\>
30 =============================
31
32 In the rest of the document, \<SHARE\_DIR\> refers to the directory where merlin
33 data files are installed.
34
35 It will usually be:
36 - "/usr/local/share" if you used manual configuration merlin
24d28a2 @def-lkb Update README.md
def-lkb authored
37 - "\<prefix\>/share" if you explicitly specified a prefix when configuring merlin
e86f8c8 @def-lkb [#65] Starting cleanup documentation…
def-lkb authored
38 - printed by the command `opam config var share`, if you used opam
39
40
1bcb132 @def-lkb Updated readme
def-lkb authored
41 Setting-up vim
42 ==============
43
44 Makes sure that ocamlmerlin binary can be found in PATH.
45
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
46 The only setup needed is to have the following directory in vim runtime path
47 (append this to your .vimrc):
43a0e28 @def-lkb Update Makefile and README for new vim(vimbufsync) setup
def-lkb authored
48
e86f8c8 @def-lkb [#65] Starting cleanup documentation…
def-lkb authored
49 :set rtp+=<SHARE_DIR>/ocamlmerlin/vim
1bcb132 @def-lkb Updated readme
def-lkb authored
50
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
51 The default configuration can be seen in:
137e958 @def-lkb Cosmetic adjustment in readme
def-lkb authored
52
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
53 <SHARE_DIR>/ocamlmerlin/vim/plugin/merlin.vim
e86f8c8 @def-lkb [#65] Starting cleanup documentation…
def-lkb authored
54
55 After adding merlin to vim runtime path, you will probably want to run
62cbd31 @def-lkb [#65] Fix too specific `:Helptags` command.
def-lkb authored
56 `:helptags <SHARE_DIR>/ocamlmerlin/vim/doc` to register merlin documentation
57 inside vim.
1bcb132 @def-lkb Updated readme
def-lkb authored
58
43a0e28 @def-lkb Update Makefile and README for new vim(vimbufsync) setup
def-lkb authored
59 Misc: description of plugin's files
60 -----------------------------------
61
e86f8c8 @def-lkb [#65] Starting cleanup documentation…
def-lkb authored
62 - \<SHARE\_DIR\>/ocamlmerlin/vim -- main vim plugin directory
43a0e28 @def-lkb Update Makefile and README for new vim(vimbufsync) setup
def-lkb authored
63 - plugin/merlin.vim -- sample configuration
64 - autoload/
65 - merlin.vim -- main vim script
66 - merlin.py -- helper script needed by merlin.vim
67 (has to be in the same directory)
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
68 - vimbufsync.vim -- library needed by merlin vim mode to keep buffer synchronized
69 - vimbufsync.py -- see https://github.com/def-lkb/vimbufsync
70 - ftdetect/
71 - merlin.vim -- sets filetype for .merlin files
72 - ftplugin/ -- used to start merlin when encountering an ocaml file
73 - ocaml.vim
74 - omlet.vim
75 - syntax/
76 - merlin.vim -- define syntax highlighting for .merlin files
77 - syntax\_checkers/
78 -- integration with syntastic (ocaml or omlet)
79 -- set g:syntastic_ocaml_checkers = ['merlin']
43a0e28 @def-lkb Update Makefile and README for new vim(vimbufsync) setup
def-lkb authored
80 -- or g:syntastic_omlet_checkers = ['merlin']
81
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
82 - \<SHARE\_DIR\>/ocamlmerlin/vimbufsync
137e958 @def-lkb Cosmetic adjustment in readme
def-lkb authored
83 -- library needed by merlin vim mode to keep buffer synchronized
43a0e28 @def-lkb Update Makefile and README for new vim(vimbufsync) setup
def-lkb authored
84
1bcb132 @def-lkb Updated readme
def-lkb authored
85
86 Emacs interface
87 ===============
88
89 merlin comes with an emacs interface (file: emacs/merlin.el) that implements a
90 minor-mode that is supposed to be used on top of tuareg-mode.
91
8a08f6a @trefis README: clean up.
trefis authored
92 All you need to do is add the following to your .emacs:
05c765c @asmanur emacs: Documentation.
asmanur authored
93
8a08f6a @trefis README: clean up.
trefis authored
94 (push "<SHARE_DIR>/emacs/site-lisp" load-path) ; directory containing merlin.el
95 (setq merlin-command "<BIN_DIR>/ocamlmerlin") ; needed only if ocamlmerlin not already in your PATH
a12cb7c @lehy README: complete/simplify instructions for Emacs
lehy authored
96 (autoload 'merlin-mode "merlin" "Merlin mode" t)
97 (add-hook 'tuareg-mode-hook 'merlin-mode)
98 (add-hook 'caml-mode-hook 'merlin-mode)
05c765c @asmanur emacs: Documentation.
asmanur authored
99
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
100 `merlin-mode` will make use of `auto-complete-mode` (available by package.el and the MELPA repository) if it is installed.
1bcb132 @def-lkb Updated readme
def-lkb authored
101
f54fd56 @asmanur Updated README.md, emacs section.
asmanur authored
102
009e915 @trefis readme: formatting + added binprot in the list of supported extensions
trefis authored
103 Merlin project
104 ==============
1bcb132 @def-lkb Updated readme
def-lkb authored
105
66f1d64 @trefis readme: updated
trefis authored
106 When loading a ml file in your editor, merlin will search for a file named
107 .merlin in the same directory as the file or in parent directories.
1bcb132 @def-lkb Updated readme
def-lkb authored
108
109 The ".merlin" allows you to integrate merlin with your project.
66f1d64 @trefis readme: updated
trefis authored
110 Each line of this file begin with a directive name followed by zero, one or more
111 arguments:
db03df4 @def-lkb Update README.md
def-lkb authored
112 - S \<src-dir\>: add a source directory, used to find \*.ml / \*.mli files
113 - B \<build-dir\>: add a build directory, used to find \*.cmi files
114 - PKG \<findlib-pkg\>: load a findlib package and its dependencies in merlin
66f1d64 @trefis readme: updated
trefis authored
115 - FLG \<flag-list\>: activates the given flags, the same effect can be achieved
116 by lauching ocamlmerlin with those flags.
117 For a full list of flags run `ocamlmerlin -help`.
118 - REC : inform merlin that it should look for .merlin files in parent
119 directories, and execute the directives it find in those files as well as the
120 ones in the current file.
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
121 - EXT \<extension-list\>: enable one or more syntax extension, separated by spaces.
122 See below for available extension.
1bcb132 @def-lkb Updated readme
def-lkb authored
123
124 Directory are either absolute or relative to the directory containing ".merlin"
125 file.
126
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
127 For a more comprehensive guide to the `.merlin` file have a look at [this
128 guide](https://github.com/the-lambda-church/merlin/wiki/project-configuration).
129
130 thread support
131 --------------
132
133 In Ocaml compiler thread support can be enabled with the ```-thread``` flag.
134
135 In Merlin the flag is not supported and you have to add ```B +threads``` directive to achieve the same effect.
136
1bcb132 @def-lkb Updated readme
def-lkb authored
137 Extensions
138 ==========
139
140 Merlin doesn't support (nor plan to support) Camlp4. However, a few common
141 extensions are hardcoded:
142
009e915 @trefis readme: formatting + added binprot in the list of supported extensions
trefis authored
143 Lwt
144 ---
145
146 Support for lwt, match\_lwt, try\_lwt / finally, for\_lwt, while\_lwt,
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
147 if\_lwt and raise\_lwt.
148
009e915 @trefis readme: formatting + added binprot in the list of supported extensions
trefis authored
149 You need to add lwt package (with ":Use lwt" or "PKG lwt" in .merlin) for
150 this to work, and it may be necessary to reload buffer for this change to
151 take effect.
152
153 type-conv
154 ---------
1bcb132 @def-lkb Updated readme
def-lkb authored
155
009e915 @trefis readme: formatting + added binprot in the list of supported extensions
trefis authored
156 A few syntax extensions based on type-conv are supported as well.
157 Namely :
158 - sexplib.syntax
159 - binprot.syntax
66f1d64 @trefis readme: updated
trefis authored
160 - fieldslib.syntax
161 - comparelib.syntax
162
163 Misc.
164 -----
165
166 Other common extensions which are supported :
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
167 - pa\_ounit.syntax as ```ounit```
168 - pa\_js.syntax as ```js```
169 - ```nonrec``` for declaring non-recursive types
89fa392 @mmottl Update README.md
mmottl authored
170 - custom\_printf.syntax as ```custom_printf```
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
171
172 The list of extensions available in your version can be directly obtained by running ```echo '["extension","list"]' | ocamlmerlin```.
8997cc8 @trefis readme: added screenshots
trefis authored
173
174 Screenshots
175 ===========
176
1fb85b8 @def-lkb Fix .gitmodules and README.md after migration to merlin2
def-lkb authored
177 - [emacs](http://iso.mor.phis.me/projects/merlin/merlin-emacs.html)
Something went wrong with that request. Please try again.