about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/wpc-ocaml.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-30T16·00+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-30T16·00+0000
commit578ed1ba98510058cf48f897a9bf4e3391684120 (patch)
tree5eadabd3d232151c75ac2424eaa8771ab25e927e /emacs/.emacs.d/wpc/wpc-ocaml.el
parent3684adf23f847114e1beeaab162398628ba571aa (diff)
Move move .emacs.d out of configs/shared
Moving all of my Emacs-related files into their own directory at the root of
this repository.
Diffstat (limited to 'emacs/.emacs.d/wpc/wpc-ocaml.el')
-rw-r--r--emacs/.emacs.d/wpc/wpc-ocaml.el43
1 files changed, 43 insertions, 0 deletions
diff --git a/emacs/.emacs.d/wpc/wpc-ocaml.el b/emacs/.emacs.d/wpc/wpc-ocaml.el
new file mode 100644
index 000000000000..26add2d6f957
--- /dev/null
+++ b/emacs/.emacs.d/wpc/wpc-ocaml.el
@@ -0,0 +1,43 @@
+;;; wpc-ocaml.el --- My OCaml preferences -*- lexical-binding: t -*-
+;; Author: William Carroll <wpcarro@gmail.com>
+
+;;; Commentary:
+;; Tooling support for OCaml development.
+;;
+;; Dependencies:
+;; - `opam install tuareg`
+;; - `opam install merlin`
+;; - `opam install user-setup && opam user-setup install`
+;; - `opam install ocamlformat`
+
+;;; Code:
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Dependencies
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(require 'prelude)
+(require 'f)
+
+(prelude/assert
+ (prelude/executable-exists? "opam"))
+
+(defvar opam-user-setup "~/.emacs.d/opam-user-setup.el"
+  "File for the OPAM Emacs integration.")
+
+(prelude/assert (f-file? opam-user-setup))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Configuration
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(use-package tuareg
+  :config
+  (add-hook-before-save 'tuareg-mode-hook #'ocamlformat-before-save))
+
+;; ocamlformat
+(require 'opam-user-setup "~/.emacs.d/opam-user-setup.el")
+(require 'ocamlformat)
+
+(provide 'wpc-ocaml)
+;;; wpc-ocaml.el ends here