Add OCaml hydra

This commit is contained in:
Maciej 2020-08-09 16:28:49 +03:00
parent c169983db6
commit 42e167a829
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
2 changed files with 16 additions and 1 deletions

View file

@ -21,6 +21,19 @@
:defer t
:ensure t)
(defhydra my-ocaml/context-hydra (:color teal :hint nil)
"
OCaml actions
^OCaml^ ^Actions^
^^^^^^^^-----------------------------------------------------------------------
_f_: Format buffer
"
("q" nil "cancel" :color blue)
("f" ocamlformat))
(defun load-ocaml-site-packages ()
"Generate ocaml config."
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
@ -33,7 +46,8 @@
(autoload 'dune "dune" nil t nil)
;; Use opam switch to lookup ocamlmerlin binary
(setq merlin-command 'opam))))
(setq merlin-command 'opam)))
(define-key tuareg-mode-map (kbd "C-c l") 'my-ocaml/context-hydra/body))
;; OCaml setup
(add-hook 'tuareg-mode-hook 'merlin-mode)