;; Enable Merlin for ML buffers (add-hook 'tuareg-mode-hook 'merlin-mode)
;; So you can do it on a mac, where `C-<up>` and `C-<down>` are used ;; by spaces. (define-key merlin-mode-map (kbd"C-c <left>") 'merlin-type-enclosing-go-up) (define-key merlin-mode-map (kbd"C-c <right>") 'merlin-type-enclosing-go-down) (set-face-background 'merlin-type-face "#88FF44")
;; -- enable auto-complete ------------------------------- ;; Not required, but useful along with merlin-mode (require 'auto-complete) (add-hook 'tuareg-mode-hook 'auto-complete-mode) (setq merlin-ac-setup 't)
;; Replace tuareg by ocp-indent (setq opam-share (substring (shell-command-to-string"opam config var share") 0-1)) (load-file (concat opam-share "/emacs/site-lisp/ocp-indent.el"))
Vim for OCaml
Vim中的配置如下,主要依赖Omni和Merlin这个神器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
" Vim needs to be built with Python scripting support, and must be " able to find Merlin's executable on PATH. ifexecutable('ocamlmerlin') && has('python') lets:ocamlmerlin = substitute(system('opam config var share'), '\n$', '', '''') . "/merlin" execute"set rtp+=".s:ocamlmerlin."/vim" execute"set rtp+=".s:ocamlmerlin."/vimbufsync" endif