-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathontop-clojure.el
91 lines (72 loc) · 2.71 KB
/
ontop-clojure.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
;;; ontop-clojure.el --- Clojure configuration -*- lexical-binding: t; -*-
;; This file is part of Emacs ONTOP
;; https://github.com/monkeyjunglejuice/emacs.ontop
;;; Commentary:
;; You can also use this file/configuration independently from Emacs ONTOP
;; Load it from anywhere via `(load-file "/path/to/ontop-clojure.el")'.
;;; Code:
;; ____________________________________________________________________________
;;; USE-PACKAGE
;; <https://github.com/jwiegley/use-package>
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package nil))
(eval-when-compile
(require 'use-package))
;; ____________________________________________________________________________
;;; CLOJURE MODE
;; <https://github.com/clojure-emacs/clojure-ts-mode>
(use-package clojure-ts-mode
:ensure t
:custom
(clojure-ts-indent-style 'fixed)
(clojure-ts-comment-macro-font-lock-body t)
(clojure-ts-ensure-grammars t))
;; ____________________________________________________________________________
;;; CIDER
;; <https://github.com/clojure-emacs/cider>
(use-package cider
:ensure t
:hook
(clojure-ts-mode . cider-mode))
;; ____________________________________________________________________________
;;; STRUCTURAL EDITING
;; SMARTPARENS
;; <https://github.com/Fuco1/smartparens>
;; <https://smartparens.readthedocs.io/en/latest/>
;; Smartparens non-strict mode is already enabled globally
;; and configured in `ontop-core.el'
;; Enable strict mode in Lisp buffers
(use-package smartparens
:ensure t
:hook
(clojure-ts-mode . smartparens-strict-mode))
;; ____________________________________________________________________________
;;; PARENTHESIS DISPLAY
;; Rainbow-delimiters color-coding of nested parens is already enabled
;; for all prog-modes in `ontop-core.el'
(use-package rainbow-delimiters
:ensure t
:hook
(cider-repl-mode . rainbow-delimiters-mode))
;; Make parens styleable, e.g. more or less prominent
;; <https://github.com/tarsius/paren-face>
;; (use-package paren-face
;; :ensure t
;; :hook
;; ((clojure-ts-mode cider-repl-mode) . paren-face-mode))
;; ____________________________________________________________________________
;;; ORG-MODE BABEL
;; <https://org-babel.readthedocs.io/en/latest/eval/>
;; Notebook-like literate programming in Emacs
;; Evaluate Clojure code in Org source code blocks via "C-c C-c"
(use-package org
:ensure nil
:hook
(org-mode . (lambda ()
(org-babel-do-load-languages
'org-babel-load-languages
(add-to-list 'org-babel-load-languages '(clojure . t))))))
;; _____________________________________________________________________________
(provide 'ontop-clojure)
;;; ontop-clojure.el ends here