Add haskell mode, update ocaml mode
This commit is contained in:
parent
005fb4fcfb
commit
c169983db6
9 changed files with 74 additions and 18 deletions
|
|
@ -3,10 +3,10 @@
|
|||
;;; Code:
|
||||
|
||||
(use-package tuareg
|
||||
:defer t
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode))
|
||||
:defer t
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode))
|
||||
|
||||
(use-package merlin
|
||||
:defer t
|
||||
|
|
@ -17,16 +17,27 @@
|
|||
:ensure t
|
||||
:config (setq refmt-command 'opam))
|
||||
|
||||
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
|
||||
(when (and opam-share (file-directory-p opam-share))
|
||||
;; Register Merlin
|
||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||
(autoload 'merlin-mode "merlin" nil t nil)
|
||||
;; Use opam switch to lookup ocamlmerlin binary
|
||||
(setq merlin-command 'opam)))
|
||||
(use-package dune
|
||||
:defer t
|
||||
:ensure t)
|
||||
|
||||
(defun load-ocaml-site-packages ()
|
||||
"Generate ocaml config."
|
||||
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
|
||||
(when (and opam-share (file-directory-p opam-share))
|
||||
;; Register Merlin
|
||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||
(autoload 'merlin-mode "merlin" nil t nil)
|
||||
(autoload 'ocamlformat "ocamlformat" nil t nil)
|
||||
(autoload 'utop "utop" nil t nil)
|
||||
(autoload 'dune "dune" nil t nil)
|
||||
|
||||
;; Use opam switch to lookup ocamlmerlin binary
|
||||
(setq merlin-command 'opam))))
|
||||
|
||||
;; OCaml setup
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode)
|
||||
(add-hook 'tuareg-mode-hook 'load-ocaml-site-packages)
|
||||
|
||||
;; Reason setup
|
||||
(add-hook 'reason-mode-hook
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue