Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. (package-initialize)
  2.  
  3. (load "/home/mohan/.opam/4.02.1/share/emacs/site-lisp/tuareg-site-file")
  4. (let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var"
  5. "share")))))
  6. (when (and opam-share (file-directory-p opam-share))
  7. ;; Register Merlin
  8. (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
  9. (autoload 'merlin-mode "merlin" nil t nil)
  10. ;; Automatically start it in OCaml buffers
  11. (add-hook 'tuareg-mode-hook 'merlin-mode t)
  12. (add-hook 'caml-mode-hook 'merlin-mode t)
  13. ;; Use opam switch to lookup ocamlmerlin binary
  14. (setq merlin-command 'opam)))
  15. (company-mode)
  16. (add-to-list 'load-path "/home/mohan/.opam/4.02.1/share/emacs/site-lisp")
  17. (require 'ocp-indent)
  18. (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
  19. (autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
  20. (autoload 'merlin-mode "merlin" "Merlin mode" t)
  21. (utop-minor-mode)
  22. ;; Important to note that setq-local is a macro and it needs to be
  23. ;; separate calls, not like setq
  24. (setq-local merlin-completion-with-doc t)
  25. (setq-local indent-tabs-mode nil)
  26. (setq-local show-trailing-whitespace t)
  27. (setq-local indent-line-function 'ocp-indent-line)
  28. (setq-local indent-region-function 'ocp-indent-region)
  29. (custom-set-variables
  30. ;; custom-set-variables was added by Custom.
  31. ;; If you edit it by hand, you could mess it up, so be careful.
  32. ;; Your init file should contain only one such instance.
  33. ;; If there is more than one, they won't work right.
  34. '(package-selected-packages (quote (company))))
  35. (custom-set-faces
  36. ;; custom-set-faces was added by Custom.
  37. ;; If you edit it by hand, you could mess it up, so be careful.
  38. ;; Your init file should contain only one such instance.
  39. ;; If there is more than one, they won't work right.
  40. )
  41. ; Make company aware of merlin
  42. (with-eval-after-load 'company
  43. (add-to-list 'company-backends 'merlin-company-backend))
  44. ; Enable company on merlin managed buffers
  45. (add-hook 'merlin-mode-hook 'company-mode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement