From f959bc4b194d2054bd4c2e2ca75d0996a537c57f Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 14 May 2016 11:53:02 -0400 Subject: [PATCH] Move popup, popwin, fill-ci, hl-todo to spacemacs-ui-visual --- .../+distribution/spacemacs-base/packages.el | 61 ------------------- .../spacemacs-ui-visual/packages.el | 59 +++++++++++++++++- 2 files changed, 56 insertions(+), 64 deletions(-) diff --git a/layers/+distribution/spacemacs-base/packages.el b/layers/+distribution/spacemacs-base/packages.el index 1d5c97703..df2ec684c 100644 --- a/layers/+distribution/spacemacs-base/packages.el +++ b/layers/+distribution/spacemacs-base/packages.el @@ -22,9 +22,7 @@ (evil-evilified-state :location local :step pre :protected t) evil-visualstar exec-path-from-shell - fill-column-indicator help-fns+ - hl-todo (hi-lock :location built-in) (holy-mode :location local :step pre) (hybrid-mode :location local :step pre) @@ -32,8 +30,6 @@ ido-vertical-mode (package-menu :location built-in) page-break-lines - popup - popwin (process-menu :location built-in) projectile (recentf :location built-in) @@ -153,35 +149,11 @@ :init (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)))) -(defun spacemacs-base/init-fill-column-indicator () - (use-package fill-column-indicator - :defer t - :init - (progn - (setq fci-rule-width 1) - (setq fci-rule-color "#D0BF8F") - ;; manually register the minor mode since it does not define any - ;; lighter - (push '(fci-mode "") minor-mode-alist) - (spacemacs|add-toggle fill-column-indicator - :status fci-mode - :on (turn-on-fci-mode) - :off (turn-off-fci-mode) - :documentation "Display the fill column indicator." - :evil-leader "tf")) - :config - (spacemacs|hide-lighter fci-mode))) - (defun spacemacs-base/init-help-fns+ () (use-package help-fns+ :commands (describe-keymap) :init (spacemacs/set-leader-keys "hdK" 'describe-keymap))) -(defun spacemacs-base/init-hl-todo () - (use-package hl-todo - :defer t - :init (spacemacs/add-to-hooks 'hl-todo-mode '(text-mode-hook - prog-mode-hook)))) (defun spacemacs-base/init-hi-lock () (spacemacs|hide-lighter hi-lock-mode)) @@ -405,39 +377,6 @@ (global-page-break-lines-mode t) (spacemacs|hide-lighter page-break-lines-mode))) -(defun spacemacs-base/init-popup () - (use-package popup - :defer t)) - -(defun spacemacs-base/init-popwin () - (use-package popwin - :config - (progn - (popwin-mode 1) - (spacemacs/set-leader-keys "wpm" 'popwin:messages) - (spacemacs/set-leader-keys "wpp" 'popwin:close-popup-window) - - ;; don't use default value but manage it ourselves - (setq popwin:special-display-config nil) - - ;; buffers that we manage - (push '("*Help*" :dedicated t :position bottom :stick t :noselect t :height 0.4) popwin:special-display-config) - (push '("*compilation*" :dedicated t :position bottom :stick t :noselect t :height 0.4) popwin:special-display-config) - (push '("*Shell Command Output*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) - (push '("*Async Shell Command*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) - (push '(" *undo-tree*" :dedicated t :position bottom :stick t :noselect nil :height 0.4) popwin:special-display-config) - (push '("*ert*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) - (push '("*grep*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) - (push '("*nosetests*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) - (push '("^\*WoMan.+\*$" :regexp t :position bottom ) popwin:special-display-config) - - (defun spacemacs/remove-popwin-display-config (str) - "Removes the popwin display configurations that matches the passed STR" - (setq popwin:special-display-config - (-remove (lambda (x) (if (and (listp x) (stringp (car x))) - (string-match str (car x)))) - popwin:special-display-config)))))) - (defun spacemacs-base/init-process-menu () (evilified-state-evilify process-menu-mode process-menu-mode-map)) diff --git a/layers/+spacemacs/spacemacs-ui-visual/packages.el b/layers/+spacemacs/spacemacs-ui-visual/packages.el index 4c3c09657..6840fc9f2 100644 --- a/layers/+spacemacs/spacemacs-ui-visual/packages.el +++ b/layers/+spacemacs/spacemacs-ui-visual/packages.el @@ -11,9 +11,13 @@ (setq spacemacs-ui-visual-packages '(fancy-battery + fill-column-indicator golden-ratio + hl-todo leuven-theme neotree + popup + popwin smooth-scrolling spaceline (zoom-frm :location local))) @@ -31,6 +35,25 @@ :evil-leader "tmb") (setq-default fancy-battery-show-percentage t)))) +(defun spacemacs-ui-visual/init-fill-column-indicator () + (use-package fill-column-indicator + :defer t + :init + (progn + (setq fci-rule-width 1) + (setq fci-rule-color "#D0BF8F") + ;; manually register the minor mode since it does not define any + ;; lighter + (push '(fci-mode "") minor-mode-alist) + (spacemacs|add-toggle fill-column-indicator + :status fci-mode + :on (turn-on-fci-mode) + :off (turn-off-fci-mode) + :documentation "Display the fill column indicator." + :evil-leader "tf")) + :config + (spacemacs|hide-lighter fci-mode))) + (defun spacemacs-ui-visual/init-golden-ratio () (use-package golden-ratio :defer t @@ -132,6 +155,12 @@ (spacemacs|diminish golden-ratio-mode " ⓖ" " g")))) +(defun spacemacs-ui-visual/init-hl-todo () + (use-package hl-todo + :defer t + :init (spacemacs/add-to-hooks 'hl-todo-mode '(text-mode-hook + prog-mode-hook)))) + (defun spacemacs-ui-visual/init-leuven-theme () (use-package leuven-theme :defer t @@ -231,12 +260,36 @@ (spacemacs/set-leader-keys "ft" 'neotree-toggle "pt" 'neotree-find-project-root)) +(defun spacemacs-ui-visual/init-popup ()) +(defun spacemacs-ui-visual/init-popwin () + (use-package popwin :config (progn - (spacemacs//neotree-key-bindings) - (add-hook 'persp-activated-hook #'spacemacs//neotree-maybe-attach-window) - (add-hook 'eyebrowse-post-window-switch-hook #'spacemacs//neotree-maybe-attach-window)))) + (popwin-mode 1) + (spacemacs/set-leader-keys "wpm" 'popwin:messages) + (spacemacs/set-leader-keys "wpp" 'popwin:close-popup-window) + + ;; don't use default value but manage it ourselves + (setq popwin:special-display-config nil) + + ;; buffers that we manage + (push '("*Help*" :dedicated t :position bottom :stick t :noselect t :height 0.4) popwin:special-display-config) + (push '("*compilation*" :dedicated t :position bottom :stick t :noselect t :height 0.4) popwin:special-display-config) + (push '("*Shell Command Output*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) + (push '("*Async Shell Command*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) + (push '(" *undo-tree*" :dedicated t :position bottom :stick t :noselect nil :height 0.4) popwin:special-display-config) + (push '("*ert*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) + (push '("*grep*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) + (push '("*nosetests*" :dedicated t :position bottom :stick t :noselect nil ) popwin:special-display-config) + (push '("^\*WoMan.+\*$" :regexp t :position bottom ) popwin:special-display-config) + + (defun spacemacs/remove-popwin-display-config (str) + "Removes the popwin display configurations that matches the passed STR" + (setq popwin:special-display-config + (-remove (lambda (x) (if (and (listp x) (stringp (car x))) + (string-match str (car x)))) + popwin:special-display-config)))))) (defun spacemacs-ui-visual/init-smooth-scrolling () (use-package smooth-scrolling