Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Setup environment variables using opam
- #+BEGIN_SRC emacs-lisp :tangle no
- (dolist (var (car (read-from-string (shell-command-to-string "opam config env --sexp"))))
- (setenv (car var) (cadr var)))
- #+END_SRC
- Add opam libs.
- #+BEGIN_SRC emacs-lisp
- (let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
- (when (and opam-share (file-directory-p opam-share))
- (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
- ))
- #+END_SRC
- Install caml, reasonml and tuareg modes.
- We don't need the tuareg package from the emacs repositories, it
- comes from opam.
- ~caml~ is required because ~caml-types-expr-face~ is used by merlin.
- #+BEGIN_SRC emacs-lisp
- (use-package caml
- :ensure t)
- (use-package tuareg
- :mode ("\\.ml[ily]?$" . tuareg-mode))
- (use-package reason-mode
- :ensure t)
- #+END_SRC
- Require ocp stuff first because of conflicts between shortcuts.
- It is installed from opam, ~ensure~ is not required.
- #+BEGIN_SRC emacs-lisp
- (use-package ocp-indent)
- (use-package ocp-index)
- #+END_SRC
- Configure merlin. Magical autocompletion and IDE features.
- #+BEGIN_SRC emacs-lisp
- (use-package merlin
- :custom
- (merlin-command 'opam)
- (merlin-completion-with-doc t)
- (company-quickhelp-mode t)
- :bind (:map merlin-mode-map
- ("M-." . merlin-locate)
- ("M-," . merlin-pop-stack)
- ("C-c C-o" . merlin-occurrences)
- ("C-c C-j" . merlin-jump)
- ("C-c i" . merlin-locate-ident)
- ("C-c C-e" . merlin-iedit-occurrences)
- )
- :hook
- ;; Start merlin on ml files
- (reason-mode . merlin-mode)
- (tuareg-mode . merlin-mode)
- (caml-mode-hook . merlin-mode)
- )
- #+END_SRC
- #+BEGIN_SRC emacs-lisp
- (use-package utop
- :hook
- (tuareg-mode . utop-minor-mode)
- (reason-mode . utop-minor-mode)
- )
- #+END_SRC
Add Comment
Please, Sign In to add comment