2016-01-30 18:53:20 +00:00
|
|
|
;;; packages.el --- Spacemacs Editing Visual Layer packages File
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 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.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(setq spacemacs-editing-visual-packages
|
|
|
|
'(
|
|
|
|
;; default
|
2018-01-25 04:58:05 +00:00
|
|
|
(hide-comnt :location local)
|
2018-11-06 23:55:34 +00:00
|
|
|
;; see https://github.com/syl20bnr/spacemacs/issues/2529
|
|
|
|
;; waiting for an overlay bug to be fixed
|
|
|
|
(hl-anything :excluded t)
|
|
|
|
column-enforce-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
highlight-indentation
|
|
|
|
highlight-numbers
|
|
|
|
highlight-parentheses
|
|
|
|
indent-guide
|
|
|
|
rainbow-delimiters
|
|
|
|
volatile-highlights
|
2018-11-06 23:55:34 +00:00
|
|
|
writeroom-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
;; Initialization of packages
|
|
|
|
|
2019-01-27 18:22:46 +00:00
|
|
|
(defun spacemacs-editing-visual/init-writeroom-mode ()
|
|
|
|
(use-package writeroom-mode
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(spacemacs|define-transient-state centered-buffer-mode
|
|
|
|
:title "Centered buffer Transient State"
|
|
|
|
:bindings
|
|
|
|
("[" writeroom-decrease-width "shrink")
|
|
|
|
("]" writeroom-increase-width "enlarge")
|
|
|
|
("=" writeroom-adjust-width "adjust width"))))
|
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
|
2016-03-22 13:38:37 +00:00
|
|
|
:commands (column-enforce-mode global-column-enforce-mode)
|
2016-03-22 01:18:36 +00:00
|
|
|
: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))
|
|
|
|
: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)
|
|
|
|
: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
|
2016-03-22 01:18:36 +00:00
|
|
|
:documentation "Globally Highlight the characters past the 80th column."
|
|
|
|
:evil-leader "t C-8"))
|
|
|
|
:config (spacemacs|diminish column-enforce-mode "⑧" "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
|
|
|
|
:init (spacemacs/set-leader-keys "ch" 'hide/show-comments-toggle)))
|
|
|
|
|
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"))
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs|diminish highlight-indentation-mode " ⓗi" " hi")
|
|
|
|
(spacemacs|diminish highlight-indentation-current-column-mode " ⓗc" " hc"))))
|
|
|
|
|
|
|
|
(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
|
|
|
|
(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
|
2016-01-30 18:53:20 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(when (member dotspacemacs-highlight-delimiters '(all current))
|
|
|
|
(add-hook 'prog-mode-hook #'highlight-parentheses-mode))
|
|
|
|
(setq hl-paren-delay 0.2)
|
2016-11-12 01:22:04 +00:00
|
|
|
(spacemacs/set-leader-keys "thp" 'highlight-parentheses-mode)
|
2016-01-30 18:53:20 +00:00
|
|
|
(setq hl-paren-colors '("Springgreen3"
|
|
|
|
"IndianRed1"
|
|
|
|
"IndianRed3"
|
|
|
|
"IndianRed4")))
|
|
|
|
:config
|
|
|
|
(spacemacs|hide-lighter highlight-parentheses-mode)
|
|
|
|
(set-face-attribute 'hl-paren-face nil :weight 'ultra-bold)))
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-hl-anything ()
|
|
|
|
(use-package hl-anything
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(hl-highlight-mode)
|
|
|
|
(setq-default hl-highlight-save-file
|
|
|
|
(concat spacemacs-cache-directory ".hl-save"))
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"hc" 'hl-unhighlight-all-local
|
|
|
|
"hC" 'hl-unhighlight-all-global
|
|
|
|
"hh" 'hl-highlight-thingatpt-local
|
|
|
|
"hH" 'hl-highlight-thingatpt-global
|
|
|
|
"hn" 'hl-find-next-thing
|
|
|
|
"hN" 'hl-find-prev-thing
|
|
|
|
"hr" 'hl-restore-highlights
|
|
|
|
"hs" 'hl-save-highlights))
|
|
|
|
:config (spacemacs|hide-lighter hl-highlight-mode)))
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-indent-guide ()
|
|
|
|
(use-package indent-guide
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-01-30 18:53:20 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq indent-guide-delay 0.3)
|
|
|
|
(spacemacs|add-toggle indent-guide
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode indent-guide-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
:documentation
|
|
|
|
"Highlight indentation level at point. (alternative to highlight-indentation)."
|
|
|
|
:evil-leader "ti")
|
|
|
|
(spacemacs|add-toggle indent-guide-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode indent-guide-global-mode
|
2016-01-30 18:53:20 +00:00
|
|
|
:documentation
|
|
|
|
"Highlight indentation level at point globally. (alternative to highlight-indentation)."
|
|
|
|
:evil-leader "t TAB"))
|
|
|
|
:config
|
|
|
|
(spacemacs|diminish indent-guide-mode " ⓘ" " i")))
|
|
|
|
|
|
|
|
(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
|
|
|
|
(spacemacs/set-leader-keys "tCd" 'rainbow-delimiters-mode)
|
|
|
|
(when (member dotspacemacs-highlight-delimiters '(any all))
|
|
|
|
(spacemacs/add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))))
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-volatile-highlights ()
|
|
|
|
(use-package volatile-highlights
|
2018-06-11 05:45:33 +00:00
|
|
|
:defer (spacemacs/defer 2)
|
2016-01-30 18:53:20 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2018-06-14 06:06:19 +00:00
|
|
|
(require 'volatile-highlights)
|
2016-06-10 04:49:13 +00:00
|
|
|
;; additional extensions
|
|
|
|
;; evil
|
|
|
|
(vhl/define-extension 'evil
|
|
|
|
'evil-move
|
|
|
|
'evil-paste-after
|
|
|
|
'evil-paste-before
|
|
|
|
'evil-paste-pop)
|
2016-06-09 21:10:03 +00:00
|
|
|
(with-eval-after-load 'evil
|
|
|
|
(vhl/install-extension 'evil)
|
|
|
|
(vhl/load-extension 'evil))
|
2016-06-10 04:49:13 +00:00
|
|
|
;; undo-tree
|
|
|
|
(vhl/define-extension 'undo-tree
|
|
|
|
'undo-tree-move
|
|
|
|
'undo-tree-yank)
|
2016-06-09 21:10:03 +00:00
|
|
|
(with-eval-after-load 'undo-tree
|
|
|
|
(vhl/install-extension 'undo-tree)
|
2016-06-10 04:49:13 +00:00
|
|
|
(vhl/load-extension 'undo-tree))
|
|
|
|
(volatile-highlights-mode)
|
|
|
|
(spacemacs|hide-lighter volatile-highlights-mode))))
|