Add variable `clojure-enable-fancify-symbol` in Clojure mode

Used to turn on fancify-symbol (default value is nil, i.e. disabled)
This commit is contained in:
Andrew Oppenlander 2015-01-28 10:24:24 -05:00 committed by syl20bnr
parent 8292d39046
commit 51066c68f3
3 changed files with 46 additions and 6 deletions

View File

@ -9,6 +9,8 @@
- [Description](#description)
- [Packages Included](#packages-included)
- [Install](#install)
- [Layer](#layer)
- [Pretty Symbols](#pretty-symbols)
- [Cider](#cider)
- [Key Bindings](#key-bindings)
- [Documentation](#documentation)
@ -31,13 +33,10 @@ This layer adds support for [Clojure][] language using [Cider][].
- [Cider Auto Complete][]
- [align-cljlet][]
### Goodies
- Pretty symbols for anonymous functions and set literals, like
`(λ [a] (+ a 5))`, `ƒ(+ % 5)`, and `∈{2 4 6}`.
## Install
### Layer
To use this contribution add it to your `~/.spacemacs`
```elisp
@ -46,6 +45,26 @@ To use this contribution add it to your `~/.spacemacs`
)
```
### Pretty Symbols
Pretty symbols for anonymous functions and set literals, like `(λ [a] (+ a 5))`, `ƒ(+ % 5)`, and `∈{2 4 6}`.
To enable this feature, add the following snippet to the dotspacemacs/config
section of your `~/.spacemacs` file:
```elisp
(setq clojure-enable-fancify-symbols t)
```
Or set this variable when loading the configuration layer:
```elisp
(setq-default dotspacemacs-configuration-layers '(
(clojure :variables
clojure-enable-fancify-symbols t))
"List of contribution to load."
)
```
### Cider
Cider requires nRepl middleware to function, please check the installation

View File

@ -0,0 +1,20 @@
;;; config.el --- Clojure Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; ---------------------------------------------------------------------------
;; Prefixes
;; ---------------------------------------------------------------------------
;; Variables
(defvar clojure-enable-fancify-symbols nil
"If non nil the `fancify-symbols' function is enabled.")

View File

@ -34,7 +34,8 @@ which require an initialization must be listed explicitly in the list.")
rainbow-delimiters-mode)))
:config
(progn
(clojure/fancify-symbols)
(when clojure-enable-fancify-symbols
(clojure/fancify-symbols))
(evil-leader/set-key-for-mode 'clojure-mode "mj" 'cider-jack-in))))
(defun clojure/init-cider ()