2015-05-19 19:20:39 +00:00
|
|
|
;;; packages.el --- Asciidoc Layer packages File for Spacemacs
|
|
|
|
;;
|
2020-09-16 21:34:40 +00:00
|
|
|
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
|
2015-05-19 19:20:39 +00:00
|
|
|
;;
|
|
|
|
;; Author: Mark Safronov <hijarian@gmail.com>
|
|
|
|
;; Author: Torben Hoffmann <torben.lehoff@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-07-31 02:17:42 +00:00
|
|
|
(setq asciidoc-packages '(adoc-mode))
|
2015-05-19 19:20:39 +00:00
|
|
|
|
|
|
|
(defun asciidoc/init-adoc-mode ()
|
|
|
|
(use-package adoc-mode
|
2015-07-31 02:17:42 +00:00
|
|
|
;; We will NOT default `.txt' files to AsciiDoc mode,
|
|
|
|
;; and `.asciidoc' extension is just plain stupid.
|
2016-03-14 21:25:19 +00:00
|
|
|
:mode (("\\.adoc?\\'" . adoc-mode))
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-05-19 19:20:39 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-07-31 02:17:42 +00:00
|
|
|
;; We have quite a lot of possible keybindings.
|
|
|
|
;; See `adoc-mode.el', its bottom part where the huge easy-menu
|
|
|
|
;; is defined and after that, where the various `tempo-template-*'
|
|
|
|
;; functions are defined.
|
2015-05-19 19:20:39 +00:00
|
|
|
|
|
|
|
;; See /doc/CONVENTIONS.md#plain-text-markup-languages
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'adoc-mode
|
|
|
|
"h1" 'tempo-template-adoc-title-1
|
2015-07-31 02:17:42 +00:00
|
|
|
;; Alternative method of inserting top-level heading
|
2015-11-18 00:38:05 +00:00
|
|
|
"hI" 'tempo-template-adoc-title-1
|
|
|
|
"h2" 'tempo-template-adoc-title-2
|
2015-07-31 02:17:42 +00:00
|
|
|
;; Alternative method of inserting the most usual heading
|
2015-11-18 00:38:05 +00:00
|
|
|
"hi" 'tempo-template-adoc-title-2
|
|
|
|
"h3" 'tempo-template-adoc-title-3
|
|
|
|
"h4" 'tempo-template-adoc-title-4
|
|
|
|
"h5" 'tempo-template-adoc-title-5
|
|
|
|
"xb" 'tempo-template-adoc-strong
|
|
|
|
"xi" 'tempo-template-adoc-emphasis)
|
2015-07-31 02:17:42 +00:00
|
|
|
;; yes, exactly like that. To "promote" title is to INCREASE its size.
|
2016-04-25 10:13:59 +00:00
|
|
|
;; `adoc-demote' does the opposite: increases its LEVEL,
|
2015-07-31 02:17:42 +00:00
|
|
|
;; which DECREASES its size.
|
2016-04-25 10:13:59 +00:00
|
|
|
(define-key adoc-mode-map (kbd "M-h") 'adoc-demote)
|
|
|
|
;; see the comment about adoc-demote above
|
2015-07-31 02:17:42 +00:00
|
|
|
(define-key adoc-mode-map (kbd "M-l") 'adoc-promote))))
|