Skip to content

Instantly share code, notes, and snippets.

@bjconlan
Last active May 4, 2021 14:45
Show Gist options
  • Save bjconlan/3410e3f3af265ecd7e50 to your computer and use it in GitHub Desktop.
Save bjconlan/3410e3f3af265ecd7e50 to your computer and use it in GitHub Desktop.
Personalized customizations to the default https://github.com/bbatsov/prelude install (.emacs.d/personal)
;; Modules
(require 'prelude-clojure) ;; prelude-modules
(prelude-require-package 'magit) ;; git support
;; Update UI/Editor state
;; Change default font to consolas falling back to dejavue
(require 'cl)
(defun font-candidate (&rest fonts)
"Return existing font which first match."
(find-if (lambda (f) (find-font (font-spec :name f))) fonts))
(set-face-attribute 'default nil :font (font-candidate '"Consolas-10:weight=normal" "DejaVu Sans Mono-10:weight=normal"))
(add-to-list 'whitespace-style 'space-mark) ;; visible whitespace
(add-to-list 'whitespace-style 'tab-mark) ;; visible whitespace
(set-default 'truncate-lines 1) ;; disable line wrapping
(global-unset-key "\C-z") ;; stop minimizing
;; http://stackoverflow.com/questions/5920786/why-is-clojure-mode-replacing-fn-with-some-curly-f-character
(eval-after-load 'clojure-mode
'(font-lock-add-keywords
'clojure-mode `(("(\\(fn\\)[\[[:space:]]"
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "λ")
nil))))))
(eval-after-load 'clojure-mode
'(font-lock-add-keywords
'clojure-mode `(("\\(#\\)("
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "ƒ")
nil))))))
(eval-after-load 'clojure-mode
'(font-lock-add-keywords
'clojure-mode `(("\\(#\\){"
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "∈")
nil))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment