2015-10-17 10:23:36 +00:00
|
|
|
;;; packages.el --- typography Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-10-17 10:23:36 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-10-17 10:23:36 +00:00
|
|
|
|
|
|
|
(setq typography-packages
|
|
|
|
'(
|
2016-05-08 18:18:05 +00:00
|
|
|
(tildify :toggle (version<= "25" emacs-version))
|
2015-10-17 10:23:36 +00:00
|
|
|
typo
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun typography/init-typo ()
|
|
|
|
(use-package typo
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-10-17 10:23:36 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(when typography-enable-typographic-editing
|
2015-11-25 14:25:04 +00:00
|
|
|
(add-hook 'text-mode-hook 'typo-mode))
|
2015-10-17 10:23:36 +00:00
|
|
|
|
|
|
|
(spacemacs|add-toggle typographic-substitutions
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode typo-mode
|
2015-10-17 10:23:36 +00:00
|
|
|
:documentation "Enable typographic substitutions"
|
2015-11-19 06:16:46 +00:00
|
|
|
:evil-leader "tT")
|
|
|
|
(spacemacs|diminish typo-mode " Ⓣ" " T"))
|
2015-11-08 18:33:23 +00:00
|
|
|
:config (setq-default typo-language "English")))
|
2015-10-17 10:23:36 +00:00
|
|
|
|
|
|
|
(defun typography/init-tildify ()
|
|
|
|
(use-package tildify
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-10-17 10:23:36 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(when typography-enable-typographic-editing
|
|
|
|
(add-hook 'text-mode-hook 'tildify-mode))
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-15 17:56:47 +00:00
|
|
|
"x~" 'tildify-region)
|
2015-10-17 10:23:36 +00:00
|
|
|
|
|
|
|
;; Use the symbolic non-breaking space for LaTeX
|
|
|
|
(defun typography/tildify-latex-space ()
|
|
|
|
"Set tildify space for LaTeX"
|
|
|
|
(setq-local tildify-space-string "~"))
|
|
|
|
(add-hook 'LaTeX-mode-hook 'typography/tildify-latex-space)
|
|
|
|
|
|
|
|
(spacemacs|add-toggle tildify-space
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode tildify-mode
|
2015-10-17 10:23:36 +00:00
|
|
|
:documentation "Enable electric non-breaking space"
|
2015-11-15 17:56:47 +00:00
|
|
|
:evil-leader "t~")
|
|
|
|
(spacemacs|diminish tildify-mode " ~" " ~"))))
|