2016-01-30 18:53:20 +00:00
|
|
|
;;; packages.el --- Spacemacs Editing Visual Layer packages File
|
|
|
|
;;
|
2017-01-06 03:51:13 +00:00
|
|
|
;; Copyright (c) 2012-2017 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
|
|
|
|
adaptive-wrap
|
2016-03-22 01:18:36 +00:00
|
|
|
column-enforce-mode
|
2016-10-17 19:25:21 +00:00
|
|
|
hide-comnt
|
2016-01-30 18:53:20 +00:00
|
|
|
highlight-indentation
|
|
|
|
highlight-numbers
|
|
|
|
highlight-parentheses
|
|
|
|
;; waiting for an overlay bug to be fixed
|
|
|
|
;; see https://github.com/syl20bnr/spacemacs/issues/2529
|
|
|
|
(hl-anything :excluded t)
|
|
|
|
indent-guide
|
|
|
|
rainbow-delimiters
|
|
|
|
volatile-highlights
|
|
|
|
))
|
|
|
|
|
|
|
|
;; Initialization of packages
|
|
|
|
|
|
|
|
(defun spacemacs-editing-visual/init-adaptive-wrap ()
|
|
|
|
(use-package adaptive-wrap
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(add-hook 'visual-line-mode-hook 'adaptive-wrap-prefix-mode))))
|
|
|
|
|
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
|
|
|
|
:defer t
|
|
|
|
: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
|
|
|
|
:defer t
|
|
|
|
: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
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(when (member dotspacemacs-highlight-delimiters '(all current))
|
|
|
|
(add-hook 'prog-mode-hook #'highlight-parentheses-mode))
|
|
|
|
(setq hl-paren-delay 0.2)
|
|
|
|
(spacemacs/set-leader-keys "tCp" 'highlight-parentheses-mode)
|
|
|
|
(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
|
|
|
|
:defer t
|
|
|
|
: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
|
|
|
|
:defer t
|
|
|
|
: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
|
|
|
|
:config
|
|
|
|
(progn
|
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))))
|