Skip to content

Commit 3f1739e

Browse files
committed
ocaml in emacs
1 parent cb4f487 commit 3f1739e

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.emacs.d/user.el

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
(server-start))
66
(setq visible-bell 1)))
77

8+
;; nix-shell
9+
(defun in-nix-shell ()
10+
(let (x (getenv "IN_NIX_SHELL"))
11+
(or (string-equal x "impure")
12+
(string-equal x "pure"))))
13+
814
;; *scratch*
915
(setq initial-major-mode 'org-mode)
1016

@@ -88,6 +94,31 @@
8894
'(lambda () (flycheck-add-next-checker 'haskell-dante
8995
'(warning . haskell-hlint))))))
9096

97+
;; ocaml
98+
(setq ngyj/merlin-site-elisp (getenv "MERLIN_SITE_LISP"))
99+
(setq ngyj/utop-site-elisp (getenv "UTOP_SITE_LISP"))
100+
(setq ngyj/ocp-site-elisp (getenv "OCP_INDENT_SITE_LISP"))
101+
102+
(use-package merlin
103+
:if (and ngyj/merlin-site-elisp
104+
(in-nix-shell))
105+
:load-path ngyj/merlin-site-elisp
106+
:hook
107+
(tuareg-mode . merlin-mode)
108+
(merlin-mode . company-mode)
109+
:custom
110+
(merlin-command "ocamlmerlin"))
111+
(use-package utop
112+
:if (and ngyj/utop-site-elisp
113+
(in-nix-shell))
114+
:load-path ngyj/utop-site-elisp
115+
:hook
116+
(tuareg-mode . utop-minor-mode))
117+
(use-package ocp-indent
118+
:if (and ngyj/ocp-site-elisp
119+
(in-nix-shell))
120+
:load-path ngyj/ocp-site-elisp)
121+
91122
;; nix
92123
(use-package nix-mode
93124
:mode "\\.nix\\'")

.shell/env

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ export PATH=$PATH:$HOME/.cabal/bin:$HOME/.local/bin
1212
# cargo
1313
export PATH=$PATH:$HOME/.cargo/bin
1414

15-
# opam
16-
eval `opam config env`
17-
1815
# rakudo
1916
#export PATH=$PATH:~/build/rakudo/rakudo-star-2018.04/install/bin/:~/build/rakudo/rakudo-star-2018.04/install/share/perl6/site/bin
2017
# }}}

0 commit comments

Comments
 (0)