Remove Fira Code stuff
This commit is contained in:
parent
43e7deb6c3
commit
c7b4f60d8d
17
config.org
17
config.org
@ -57,23 +57,6 @@ needs to be set up to install them if they aren't already.
|
|||||||
(load-theme 'spacemacs-light t)
|
(load-theme 'spacemacs-light t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Font
|
|
||||||
|
|
||||||
I am addicted to programming ligatures but Fira Code (my preferred
|
|
||||||
ligature font) requires some hackery to display properly; this is
|
|
||||||
defined in [[file:fira-code-mode/fira-code-mode.el][fira-code-mode.el]] so first we load that.
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(add-to-list 'load-path "/home/cdo/.emacs.d/fira-code-mode")
|
|
||||||
(require 'fira-code-mode)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
And then make sure that mode is enabled for any =prog-mode= buffer.
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(add-hook 'prog-mode-hook 'fira-code-mode)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Org-mode
|
* Org-mode
|
||||||
|
|
||||||
I use a couple non-standard bits and pieces, but not a whole bunch. I
|
I use a couple non-standard bits and pieces, but not a whole bunch. I
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
(defun fira-code-mode--make-alist (list)
|
|
||||||
"Generate prettify-symbols alist from LIST."
|
|
||||||
(let ((idx -1))
|
|
||||||
(mapcar
|
|
||||||
(lambda (s)
|
|
||||||
(setq idx (1+ idx))
|
|
||||||
(let* ((code (+ #Xe100 idx))
|
|
||||||
(width (string-width s))
|
|
||||||
(prefix ())
|
|
||||||
(suffix '(?\s (Br . Br)))
|
|
||||||
(n 1))
|
|
||||||
(while (< n width)
|
|
||||||
(setq prefix (append prefix '(?\s (Br . Bl))))
|
|
||||||
(setq n (1+ n)))
|
|
||||||
(cons s (append prefix suffix (list (decode-char 'ucs code))))))
|
|
||||||
list)))
|
|
||||||
|
|
||||||
(defconst fira-code-mode--ligatures
|
|
||||||
'("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\"
|
|
||||||
"{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}"
|
|
||||||
"--" "---" "-->" "->" "->>" "-<" "-<<" "-~"
|
|
||||||
"#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_("
|
|
||||||
".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*"
|
|
||||||
"/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||="
|
|
||||||
"|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "=="
|
|
||||||
"===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">="
|
|
||||||
">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>"
|
|
||||||
"<$" "<$>" "<!--" "<-" "<--" "<->" "<+" "<+>" "<="
|
|
||||||
"<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<" "<~"
|
|
||||||
"<~~" "</" "</>" "~@" "~-" "~=" "~>" "~~" "~~>" "%%"))
|
|
||||||
|
|
||||||
(defvar fira-code-mode--old-prettify-alist)
|
|
||||||
|
|
||||||
(defun fira-code-mode--enable ()
|
|
||||||
"Enable Fira Code ligatures in current buffer."
|
|
||||||
(setq-local fira-code-mode--old-prettify-alist prettify-symbols-alist)
|
|
||||||
(setq-local prettify-symbols-alist (append (fira-code-mode--make-alist fira-code-mode--ligatures) fira-code-mode--old-prettify-alist))
|
|
||||||
(prettify-symbols-mode t))
|
|
||||||
|
|
||||||
(defun fira-code-mode--disable ()
|
|
||||||
"Disable Fira Code ligatures in current buffer."
|
|
||||||
(setq-local prettify-symbols-alist fira-code-mode--old-prettify-alist)
|
|
||||||
(prettify-symbols-mode -1))
|
|
||||||
|
|
||||||
(define-minor-mode fira-code-mode
|
|
||||||
"Fira Code ligatures minor mode"
|
|
||||||
:lighter " Fira Code"
|
|
||||||
(setq-local prettify-symbols-unprettify-at-point 'right-edge)
|
|
||||||
(if fira-code-mode
|
|
||||||
(fira-code-mode--enable)
|
|
||||||
(fira-code-mode--disable)))
|
|
||||||
|
|
||||||
(defun fira-code-mode--setup ()
|
|
||||||
"Setup Fira Code Symbols"
|
|
||||||
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))
|
|
||||||
|
|
||||||
(provide 'fira-code-mode)
|
|
Loading…
x
Reference in New Issue
Block a user