defaults: add SPC T N key binding to cycle theme backward

This commit is contained in:
syl20bnr 2019-02-10 10:10:51 -05:00
parent 66f7b9dda1
commit 474f945709
2 changed files with 12 additions and 4 deletions

View File

@ -332,7 +332,7 @@ THEME."
(load-theme ',theme-name t))))))
(defun spacemacs/cycle-spacemacs-theme (&optional backward)
"Cycle through themes defined in `dotspacemacs-themes.'
"Cycle through themes defined in `dotspacemacs-themes'.
When BACKWARD is non-nil, or with universal-argument, cycle backwards."
(interactive "P")
(let* ((themes (if backward (reverse dotspacemacs-themes) dotspacemacs-themes))
@ -348,6 +348,11 @@ When BACKWARD is non-nil, or with universal-argument, cycle backwards."
(spacemacs/load-theme next-theme nil 'disable)
(progress-reporter-done progress-reporter))))
(defun spacemacs/cycle-spacemacs-theme-backward ()
"Cycle through themes defined in `dotspacemacs-themes' backward."
(interactive)
(spacemacs/cycle-spacemacs-theme t))
(defadvice load-theme (after spacemacs/load-theme-adv activate)
"Perform post load processing."
(let ((theme (ad-get-arg 0)))

View File

@ -156,16 +156,19 @@
;; Cycling settings -----------------------------------------------------------
(spacemacs|define-transient-state theme
:title "Themes Transient State"
:doc "\n[_n_/_<right>_] next [_p_/_<left>_] previous [_t_/_<up>_] helm-themes"
:doc "\n[_n_/_<right>_] next [_N_/_p_/_<left>_] previous [_t_/_<up>_] helm-themes"
:bindings
("n" spacemacs/cycle-spacemacs-theme)
("p" (spacemacs/cycle-spacemacs-theme 'backward))
("N" spacemacs/cycle-spacemacs-theme-backward)
("p" spacemacs/cycle-spacemacs-theme-backward)
("t" helm-themes)
("<up>" helm-themes)
("<right>" spacemacs/cycle-spacemacs-theme)
("<left>" (spacemacs/cycle-spacemacs-theme 'backward)))
("<left>" spacemacs/cycle-spacemacs-theme-backward))
(spacemacs/set-leader-keys "Tn"
'spacemacs/theme-transient-state/spacemacs/cycle-spacemacs-theme)
(spacemacs/set-leader-keys "TN"
'spacemacs/theme-transient-state/spacemacs/cycle-spacemacs-theme-backward)
;; errors ---------------------------------------------------------------------
(spacemacs/set-leader-keys
"en" 'spacemacs/next-error