2016-01-30 18:53:20 +00:00
|
|
|
|
;;; packages.el --- Spacemacs Editing Visual Layer packages File
|
|
|
|
|
;;
|
2022-02-12 04:58:35 +00:00
|
|
|
|
;; Copyright (c) 2012-2022 Sylvain Benner & Contributors
|
2016-01-30 18:53:20 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.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/>.
|
|
|
|
|
|
2022-02-12 04:58:35 +00:00
|
|
|
|
;;; Commentary:
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
2022-02-12 04:58:35 +00:00
|
|
|
|
;;; Code:
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(defconst spacemacs-editing-visual-packages
|
|
|
|
|
'(
|
|
|
|
|
column-enforce-mode
|
|
|
|
|
(hide-comnt :location (recipe :fetcher github :repo "emacsmirror/hide-comnt"))
|
|
|
|
|
highlight-indentation
|
|
|
|
|
highlight-numbers
|
|
|
|
|
highlight-parentheses
|
|
|
|
|
indent-guide
|
|
|
|
|
rainbow-delimiters
|
2022-07-13 03:27:29 +00:00
|
|
|
|
(term-cursor :location (recipe :fetcher github :repo "h0d/term-cursor.el"))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
volatile-highlights
|
|
|
|
|
writeroom-mode))
|
|
|
|
|
|
2018-03-05 01:36:40 +00:00
|
|
|
|
|
2016-03-22 01:18:36 +00:00
|
|
|
|
(defun spacemacs-editing-visual/init-column-enforce-mode ()
|
|
|
|
|
(use-package column-enforce-mode
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2016-03-22 13:38:37 +00:00
|
|
|
|
(spacemacs|add-toggle highlight-long-lines
|
2016-03-22 01:18:36 +00:00
|
|
|
|
:status column-enforce-mode
|
2016-03-22 16:32:21 +00:00
|
|
|
|
:prefix columns
|
|
|
|
|
:on (column-enforce-n (or columns column-enforce-column))
|
2019-01-19 09:24:10 +00:00
|
|
|
|
:on-message (format "long-lines enabled for %s columns."
|
|
|
|
|
(or columns column-enforce-column))
|
2016-03-22 01:18:36 +00:00
|
|
|
|
:off (column-enforce-mode -1)
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:off-message (format "long-lines disabled for %s columns."
|
|
|
|
|
(or columns column-enforce-column))
|
2016-03-22 01:18:36 +00:00
|
|
|
|
:documentation "Highlight the characters past the 80th column."
|
|
|
|
|
:evil-leader "t8")
|
2016-03-22 13:38:37 +00:00
|
|
|
|
(spacemacs|add-toggle highlight-long-lines-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
|
:mode global-column-enforce-mode
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:documentation "Globally highlight the characters past the 80th column."
|
2016-03-22 01:18:36 +00:00
|
|
|
|
:evil-leader "t C-8"))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:spacediminish ("⑧" "8")))
|
|
|
|
|
|
2016-10-17 19:25:21 +00:00
|
|
|
|
(defun spacemacs-editing-visual/init-hide-comnt ()
|
|
|
|
|
(use-package hide-comnt
|
|
|
|
|
:commands hide/show-comments-toggle
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(advice-add 'hide/show-comments
|
|
|
|
|
:after (lambda (&optional hide/show start end)
|
|
|
|
|
(pcase hide/show
|
|
|
|
|
('hide (message "Hide comments enabled."))
|
|
|
|
|
('show (message "Hide comments disabled.")))))
|
|
|
|
|
(spacemacs/set-leader-keys "ch" 'hide/show-comments-toggle))))
|
2016-10-17 19:25:21 +00:00
|
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
|
(defun spacemacs-editing-visual/init-highlight-indentation ()
|
|
|
|
|
(use-package highlight-indentation
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(spacemacs|add-toggle highlight-indentation
|
2016-05-31 13:11:00 +00:00
|
|
|
|
:mode highlight-indentation-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:documentation "Highlight indentation levels."
|
|
|
|
|
:evil-leader "thi")
|
|
|
|
|
(spacemacs|add-toggle highlight-indentation-current-column
|
2016-05-31 13:11:00 +00:00
|
|
|
|
:mode highlight-indentation-current-column-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:documentation "Highlight indentation level at point."
|
|
|
|
|
:evil-leader "thc"))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:spacediminish ((" ⓗi" " hi")
|
|
|
|
|
(highlight-indentation-current-column-mode " ⓗc" " hc"))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-highlight-numbers ()
|
|
|
|
|
(use-package highlight-numbers
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(spacemacs|add-toggle highlight-numbers
|
|
|
|
|
:mode highlight-numbers-mode
|
|
|
|
|
:documentation "Highlight numeric literals."
|
|
|
|
|
:evil-leader "thn")
|
2016-01-30 18:53:20 +00:00
|
|
|
|
(add-hook 'prog-mode-hook 'highlight-numbers-mode)
|
|
|
|
|
(add-hook 'asm-mode-hook (lambda () (highlight-numbers-mode -1))))))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-highlight-parentheses ()
|
|
|
|
|
(use-package highlight-parentheses
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:custom
|
|
|
|
|
(highlight-parentheses-delay 0.2)
|
|
|
|
|
(highlight-parentheses-colors '("Springgreen3"
|
|
|
|
|
"IndianRed1"
|
|
|
|
|
"IndianRed3"
|
|
|
|
|
"IndianRed4"))
|
|
|
|
|
:custom-face (highlight-parentheses-highlight ((nil (:weight ultra-bold))))
|
|
|
|
|
:commands highlight-parentheses-minibuffer-setup
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:init
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(spacemacs|add-toggle highlight-parentheses
|
|
|
|
|
:mode highlight-parentheses-mode
|
|
|
|
|
:documentation "Highlight surrounding parentheses."
|
|
|
|
|
:evil-leader "thp")
|
|
|
|
|
(spacemacs|add-toggle highlight-parentheses-globally
|
|
|
|
|
:mode global-highlight-parentheses-mode
|
|
|
|
|
:documentation "Globally highlight surrounding parentheses."
|
|
|
|
|
:evil-leader "thP")
|
2016-01-30 18:53:20 +00:00
|
|
|
|
(progn
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(when (memq dotspacemacs-highlight-delimiters '(all current))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
(add-hook 'prog-mode-hook #'highlight-parentheses-mode))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(when (eq dotspacemacs-highlight-delimiters 'all)
|
|
|
|
|
(add-hook 'minibuffer-setup-hook #'highlight-parentheses-minibuffer-setup)))
|
|
|
|
|
:config (spacemacs|hide-lighter highlight-parentheses-mode)))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-indent-guide ()
|
|
|
|
|
(use-package indent-guide
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:custom
|
|
|
|
|
(indent-guide-delay 0.3)
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(spacemacs|add-toggle indent-guide
|
2016-05-31 13:11:00 +00:00
|
|
|
|
:mode indent-guide-mode
|
2019-04-26 21:58:18 +00:00
|
|
|
|
:documentation "Highlight indentation level at point. (alternative to highlight-indentation)."
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:evil-leader "ti")
|
|
|
|
|
(spacemacs|add-toggle indent-guide-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
|
:mode indent-guide-global-mode
|
2019-04-26 21:58:18 +00:00
|
|
|
|
:documentation "Highlight indentation level at point globally. (alternative to highlight-indentation)."
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:evil-leader "t TAB"))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:spacediminish (" ⓘ" " i")))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-rainbow-delimiters ()
|
|
|
|
|
(use-package rainbow-delimiters
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:init
|
|
|
|
|
(progn
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(spacemacs|add-toggle rainbow-delimiters
|
|
|
|
|
:mode rainbow-delimiters-mode
|
|
|
|
|
:documentation "Highlight nested parentheses, brackets, and braces according to their depth."
|
|
|
|
|
:evil-leader "tCd")
|
|
|
|
|
(when (memq dotspacemacs-highlight-delimiters '(any all))
|
|
|
|
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)))))
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-term-cursor ()
|
|
|
|
|
(use-package term-cursor
|
|
|
|
|
:defer t
|
2022-08-05 04:29:18 +00:00
|
|
|
|
:init
|
|
|
|
|
(when (display-graphic-p)
|
|
|
|
|
(global-term-cursor-mode))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-volatile-highlights ()
|
|
|
|
|
(use-package volatile-highlights
|
2022-02-12 04:58:35 +00:00
|
|
|
|
:defer t
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(spacemacs|add-toggle volatile-highlights
|
|
|
|
|
:mode volatile-highlights-mode
|
|
|
|
|
:documentation "Display visual feedback for some operations."
|
|
|
|
|
:evil-leader "thv")
|
|
|
|
|
(volatile-highlights-mode t))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
:config
|
|
|
|
|
(progn
|
2016-06-10 04:49:13 +00:00
|
|
|
|
;; additional extensions
|
|
|
|
|
;; evil
|
2016-06-09 21:10:03 +00:00
|
|
|
|
(with-eval-after-load 'evil
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(vhl/define-extension 'evil
|
|
|
|
|
'evil-move
|
|
|
|
|
'evil-paste-after
|
|
|
|
|
'evil-paste-before
|
|
|
|
|
'evil-paste-pop)
|
2016-06-09 21:10:03 +00:00
|
|
|
|
(vhl/install-extension 'evil)
|
|
|
|
|
(vhl/load-extension 'evil))
|
2016-06-10 04:49:13 +00:00
|
|
|
|
;; undo-tree
|
2016-06-09 21:10:03 +00:00
|
|
|
|
(with-eval-after-load 'undo-tree
|
2022-02-12 04:58:35 +00:00
|
|
|
|
(vhl/define-extension 'undo-tree
|
|
|
|
|
'undo-tree-move
|
|
|
|
|
'undo-tree-yank)
|
2016-06-09 21:10:03 +00:00
|
|
|
|
(vhl/install-extension 'undo-tree)
|
2016-06-10 04:49:13 +00:00
|
|
|
|
(vhl/load-extension 'undo-tree))
|
|
|
|
|
(spacemacs|hide-lighter volatile-highlights-mode))))
|
2022-02-12 04:58:35 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-writeroom-mode ()
|
|
|
|
|
(use-package writeroom-mode
|
|
|
|
|
:defer t
|
|
|
|
|
:custom (writeroom-mode-line-toggle-position 'mode-line-format)
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
|
|
|
|
(spacemacs|add-toggle centered-buffer
|
|
|
|
|
:status writeroom-mode
|
|
|
|
|
:on (let ((writeroom-maximize-window nil)
|
|
|
|
|
(writeroom-mode-line t))
|
|
|
|
|
(writeroom-mode 1))
|
|
|
|
|
:on-message "Centered-buffer is enabled."
|
|
|
|
|
:off (writeroom-mode -1)
|
|
|
|
|
:off-message "Centered-buffer is disabled."
|
|
|
|
|
:documentation "Centerize current buffer."
|
|
|
|
|
:evil-leader "wcc")
|
|
|
|
|
(spacemacs|add-toggle distraction-free
|
|
|
|
|
:status writeroom-mode
|
|
|
|
|
:on (let ((writeroom-maximize-window t)
|
|
|
|
|
(writeroom-mode-line nil))
|
|
|
|
|
(writeroom-mode 1))
|
|
|
|
|
:on-message "Distraction-free is enabled."
|
|
|
|
|
:off (writeroom-mode -1)
|
|
|
|
|
:off-message "Distraction-free is disabled."
|
|
|
|
|
:documentation "Centerize and maximize current buffer."
|
|
|
|
|
:evil-leader "wcC")
|
|
|
|
|
(spacemacs/set-leader-keys "wc." #'spacemacs/centered-buffer-transient-state)
|
|
|
|
|
(spacemacs|define-transient-state centered-buffer
|
|
|
|
|
:title "Centered Buffer Transient State"
|
|
|
|
|
:bindings
|
|
|
|
|
("m" writeroom-toggle-mode-line "modeline")
|
|
|
|
|
("[" writeroom-decrease-width "shrink")
|
|
|
|
|
("]" writeroom-increase-width "enlarge")
|
|
|
|
|
("=" writeroom-adjust-width "adjust width")))))
|
|
|
|
|
|
|
|
|
|
;;; packages.el ends here
|