2016-03-21 01:48:06 +00:00
|
|
|
|
;;; packages.el --- Spacemacs Layouts Layer packages File for Spacemacs
|
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2016-03-21 01:48:06 +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/>.
|
|
|
|
|
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
(setq spacemacs-layouts-packages
|
|
|
|
|
'(eyebrowse
|
|
|
|
|
helm
|
2016-10-02 07:29:55 +00:00
|
|
|
|
ivy
|
2016-04-13 02:05:24 +00:00
|
|
|
|
persp-mode
|
2016-03-21 01:48:06 +00:00
|
|
|
|
spaceline
|
2021-06-22 05:17:38 +00:00
|
|
|
|
consult
|
2019-07-28 04:41:58 +00:00
|
|
|
|
(counsel-projectile :requires ivy)))
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/init-eyebrowse ()
|
|
|
|
|
(use-package eyebrowse
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2016-03-25 14:37:03 +00:00
|
|
|
|
(setq eyebrowse-wrap-around t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
(eyebrowse-mode)
|
|
|
|
|
;; transient state
|
|
|
|
|
(spacemacs|transient-state-format-hint workspaces
|
|
|
|
|
spacemacs--workspaces-ts-full-hint
|
2019-05-16 15:17:30 +00:00
|
|
|
|
"\n
|
|
|
|
|
Go to^^^^^^ Actions^^^^
|
|
|
|
|
─────^^^^^^─────────────────────── ───────^^^^───────────────────────
|
|
|
|
|
[_0_.._9_]^^ nth/new workspace [_c_/_C_] clone workspace
|
|
|
|
|
[_C-0_.._C-9_]^^ nth/new workspace [_s_/_S_] single window workspace
|
|
|
|
|
[_<tab>_]^^^^ last workspace [_d_]^^ close current workspace
|
|
|
|
|
[_n_/_C-l_]^^ next workspace [_R_]^^ rename current workspace
|
|
|
|
|
[_N_/_p_/_C-h_] prev workspace [_?_]^^ toggle help
|
|
|
|
|
[_w_]^^^^ another workspace
|
|
|
|
|
[_l_]^^^^ layouts TS")
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
(spacemacs|define-transient-state workspaces
|
|
|
|
|
:title "Workspaces Transient State"
|
|
|
|
|
:hint-is-doc t
|
|
|
|
|
:dynamic-hint (spacemacs//workspaces-ts-hint)
|
|
|
|
|
:bindings
|
|
|
|
|
("?" spacemacs//workspaces-ts-toggle-hint)
|
2021-04-30 18:31:33 +00:00
|
|
|
|
("0" spacemacs/eyebrowse-switch-to-window-config-0 :exit t)
|
|
|
|
|
("1" spacemacs/eyebrowse-switch-to-window-config-1 :exit t)
|
|
|
|
|
("2" spacemacs/eyebrowse-switch-to-window-config-2 :exit t)
|
|
|
|
|
("3" spacemacs/eyebrowse-switch-to-window-config-3 :exit t)
|
|
|
|
|
("4" spacemacs/eyebrowse-switch-to-window-config-4 :exit t)
|
|
|
|
|
("5" spacemacs/eyebrowse-switch-to-window-config-5 :exit t)
|
|
|
|
|
("6" spacemacs/eyebrowse-switch-to-window-config-6 :exit t)
|
|
|
|
|
("7" spacemacs/eyebrowse-switch-to-window-config-7 :exit t)
|
|
|
|
|
("8" spacemacs/eyebrowse-switch-to-window-config-8 :exit t)
|
|
|
|
|
("9" spacemacs/eyebrowse-switch-to-window-config-9 :exit t)
|
|
|
|
|
("C-0" spacemacs/eyebrowse-switch-to-window-config-0)
|
|
|
|
|
("C-1" spacemacs/eyebrowse-switch-to-window-config-1)
|
|
|
|
|
("C-2" spacemacs/eyebrowse-switch-to-window-config-2)
|
|
|
|
|
("C-3" spacemacs/eyebrowse-switch-to-window-config-3)
|
|
|
|
|
("C-4" spacemacs/eyebrowse-switch-to-window-config-4)
|
|
|
|
|
("C-5" spacemacs/eyebrowse-switch-to-window-config-5)
|
|
|
|
|
("C-6" spacemacs/eyebrowse-switch-to-window-config-6)
|
|
|
|
|
("C-7" spacemacs/eyebrowse-switch-to-window-config-7)
|
|
|
|
|
("C-8" spacemacs/eyebrowse-switch-to-window-config-8)
|
|
|
|
|
("C-9" spacemacs/eyebrowse-switch-to-window-config-9)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("<tab>" eyebrowse-last-window-config)
|
2016-11-02 10:52:16 +00:00
|
|
|
|
("<return>" nil :exit t)
|
|
|
|
|
("TAB" eyebrowse-last-window-config)
|
|
|
|
|
("RET" nil :exit t)
|
2021-04-19 08:18:32 +00:00
|
|
|
|
("c" spacemacs/clone-workspace :exit t)
|
|
|
|
|
("C" spacemacs/clone-workspace)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("C-h" eyebrowse-prev-window-config)
|
|
|
|
|
("C-l" eyebrowse-next-window-config)
|
2021-04-30 18:31:33 +00:00
|
|
|
|
("d" spacemacs/eyebrowse-close-window-config)
|
2016-03-30 18:29:55 +00:00
|
|
|
|
("l" spacemacs/layouts-transient-state/body :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("n" eyebrowse-next-window-config)
|
|
|
|
|
("N" eyebrowse-prev-window-config)
|
|
|
|
|
("p" eyebrowse-prev-window-config)
|
|
|
|
|
("R" spacemacs/workspaces-ts-rename :exit t)
|
2019-05-17 13:11:24 +00:00
|
|
|
|
("s" spacemacs/single-win-workspace :exit t)
|
|
|
|
|
("S" spacemacs/single-win-workspace)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("w" eyebrowse-switch-to-window-config :exit t))
|
2016-03-25 05:12:30 +00:00
|
|
|
|
;; note: we don't need to declare the `SPC l w' binding, it is
|
|
|
|
|
;; declare in the layout transient state
|
|
|
|
|
(spacemacs/set-leader-keys "bW" 'spacemacs/goto-buffer-workspace)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
;; hooks
|
2017-10-27 00:58:41 +00:00
|
|
|
|
(when (configuration-layer/package-used-p 'persp-mode)
|
|
|
|
|
(add-hook 'persp-before-switch-functions
|
|
|
|
|
#'spacemacs/update-eyebrowse-for-perspective)
|
|
|
|
|
(add-hook 'eyebrowse-post-window-switch-hook
|
|
|
|
|
#'spacemacs/save-eyebrowse-for-perspective)
|
|
|
|
|
(add-hook 'persp-activated-functions
|
|
|
|
|
#'spacemacs/load-eyebrowse-for-perspective)
|
|
|
|
|
(add-hook 'persp-before-save-state-to-file-functions
|
|
|
|
|
#'spacemacs/update-eyebrowse-for-perspective)
|
|
|
|
|
(add-hook 'persp-after-load-state-functions
|
2018-08-23 00:27:59 +00:00
|
|
|
|
#'spacemacs/load-eyebrowse-after-loading-layout))
|
2016-03-21 01:48:06 +00:00
|
|
|
|
;; vim-style tab switching
|
|
|
|
|
(define-key evil-motion-state-map "gt" 'eyebrowse-next-window-config)
|
|
|
|
|
(define-key evil-motion-state-map "gT" 'eyebrowse-prev-window-config))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/post-init-helm ()
|
2020-06-05 04:04:41 +00:00
|
|
|
|
(with-eval-after-load 'helm (spacemacs//persp-helm-setup))
|
2016-03-21 01:48:06 +00:00
|
|
|
|
(spacemacs/set-leader-keys
|
2016-11-09 13:41:02 +00:00
|
|
|
|
"bB" 'spacemacs-layouts/non-restricted-buffer-list-helm
|
2016-03-21 01:48:06 +00:00
|
|
|
|
"pl" 'spacemacs/helm-persp-switch-project))
|
|
|
|
|
|
2016-10-02 07:29:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/post-init-ivy ()
|
|
|
|
|
(spacemacs/set-leader-keys
|
2016-11-09 13:41:02 +00:00
|
|
|
|
"bB" 'spacemacs-layouts/non-restricted-buffer-list-ivy))
|
2016-10-02 07:29:55 +00:00
|
|
|
|
|
2019-07-31 04:34:51 +00:00
|
|
|
|
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/init-persp-mode ()
|
|
|
|
|
(use-package persp-mode
|
|
|
|
|
:init
|
|
|
|
|
(progn
|
2018-08-04 00:55:18 +00:00
|
|
|
|
(setq persp-add-buffer-on-after-change-major-mode 'free
|
|
|
|
|
persp-auto-resume-time (if (or dotspacemacs-auto-resume-layouts
|
2016-03-21 01:48:06 +00:00
|
|
|
|
spacemacs-force-resume-layouts)
|
|
|
|
|
1 -1)
|
2017-04-12 04:04:38 +00:00
|
|
|
|
persp-is-ibc-as-f-supported nil
|
2016-03-21 01:48:06 +00:00
|
|
|
|
persp-nil-name dotspacemacs-default-layout-name
|
|
|
|
|
persp-reset-windows-on-nil-window-conf nil
|
|
|
|
|
persp-set-last-persp-for-new-frames nil
|
2016-08-20 14:45:56 +00:00
|
|
|
|
persp-save-dir spacemacs-layouts-directory
|
2016-09-19 10:51:57 +00:00
|
|
|
|
persp-set-ido-hooks t)
|
2016-05-02 21:34:39 +00:00
|
|
|
|
|
|
|
|
|
(spacemacs/defer-until-after-user-config #'spacemacs//activate-persp-mode)
|
|
|
|
|
|
2016-03-21 01:48:06 +00:00
|
|
|
|
;; layouts transient state
|
|
|
|
|
(spacemacs|transient-state-format-hint layouts
|
|
|
|
|
spacemacs--layouts-ts-full-hint
|
2019-05-16 15:17:30 +00:00
|
|
|
|
"\n
|
|
|
|
|
Go to^^^^^^ Actions^^^^
|
|
|
|
|
─────^^^^^^────────────────────── ───────^^^^───────────────────────────────
|
|
|
|
|
[_0_.._9_]^^ nth/new layout [_a_]^^ add buffer
|
|
|
|
|
[_C-0_.._C-9_]^^ nth/new layout [_A_]^^ add all buffers from layout
|
|
|
|
|
[_<tab>_]^^^^ last layout [_d_]^^ close current layout
|
|
|
|
|
[_n_/_C-l_]^^ next layout [_D_]^^ close other layout
|
|
|
|
|
[_N_/_p_/_C-h_] prev layout [_L_]^^ load layouts from file
|
|
|
|
|
[_b_]^^^^ buffer in layout [_r_]^^ remove current buffer
|
|
|
|
|
[_h_]^^^^ default layout [_R_]^^ rename current layout
|
|
|
|
|
[_l_]^^^^ another layout [_s_/_S_] save all layouts/save by names
|
|
|
|
|
[_o_]^^^^ custom layout [_t_]^^ show buffer w/o adding to layout
|
|
|
|
|
[_w_]^^^^ workspaces TS [_x_]^^ kill current w/buffers
|
2020-03-31 19:31:50 +00:00
|
|
|
|
[_e_]^^^^ select layout [_X_]^^ kill other w/buffers
|
2019-05-16 15:17:30 +00:00
|
|
|
|
^^^^^^ [_<_/_>_] move layout left/right
|
|
|
|
|
^^^^^^ [_?_]^^ toggle help")
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
(spacemacs|define-transient-state layouts
|
|
|
|
|
:title "Layouts Transient State"
|
|
|
|
|
:hint-is-doc t
|
|
|
|
|
:dynamic-hint (spacemacs//layouts-ts-hint)
|
|
|
|
|
:bindings
|
|
|
|
|
;; need to exit in case number doesn't exist
|
|
|
|
|
("?" spacemacs//layouts-ts-toggle-hint)
|
|
|
|
|
("1" spacemacs/persp-switch-to-1 :exit t)
|
|
|
|
|
("2" spacemacs/persp-switch-to-2 :exit t)
|
|
|
|
|
("3" spacemacs/persp-switch-to-3 :exit t)
|
|
|
|
|
("4" spacemacs/persp-switch-to-4 :exit t)
|
|
|
|
|
("5" spacemacs/persp-switch-to-5 :exit t)
|
|
|
|
|
("6" spacemacs/persp-switch-to-6 :exit t)
|
|
|
|
|
("7" spacemacs/persp-switch-to-7 :exit t)
|
|
|
|
|
("8" spacemacs/persp-switch-to-8 :exit t)
|
|
|
|
|
("9" spacemacs/persp-switch-to-9 :exit t)
|
|
|
|
|
("0" spacemacs/persp-switch-to-0 :exit t)
|
2020-03-31 19:31:50 +00:00
|
|
|
|
("e" spacemacs/layout-switch-to :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("C-1" spacemacs/persp-switch-to-1)
|
|
|
|
|
("C-2" spacemacs/persp-switch-to-2)
|
|
|
|
|
("C-3" spacemacs/persp-switch-to-3)
|
|
|
|
|
("C-4" spacemacs/persp-switch-to-4)
|
|
|
|
|
("C-5" spacemacs/persp-switch-to-5)
|
|
|
|
|
("C-6" spacemacs/persp-switch-to-6)
|
|
|
|
|
("C-7" spacemacs/persp-switch-to-7)
|
|
|
|
|
("C-8" spacemacs/persp-switch-to-8)
|
|
|
|
|
("C-9" spacemacs/persp-switch-to-9)
|
|
|
|
|
("C-0" spacemacs/persp-switch-to-0)
|
2019-12-18 20:57:26 +00:00
|
|
|
|
("<tab>" spacemacs/jump-to-last-layout :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("<return>" nil :exit t)
|
2016-11-02 10:52:16 +00:00
|
|
|
|
("TAB" spacemacs/jump-to-last-layout)
|
|
|
|
|
("RET" nil :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("C-h" persp-prev)
|
|
|
|
|
("C-l" persp-next)
|
2017-09-16 09:27:33 +00:00
|
|
|
|
("<" spacemacs/move-current-persp-left)
|
|
|
|
|
(">" spacemacs/move-current-persp-right)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("a" persp-add-buffer :exit t)
|
|
|
|
|
("A" persp-import-buffers :exit t)
|
2017-09-28 13:41:31 +00:00
|
|
|
|
("b" spacemacs/persp-buffers :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("d" spacemacs/layouts-ts-close)
|
|
|
|
|
("D" spacemacs/layouts-ts-close-other :exit t)
|
|
|
|
|
("h" spacemacs/layout-goto-default :exit t)
|
|
|
|
|
("L" persp-load-state-from-file :exit t)
|
2017-09-28 13:41:31 +00:00
|
|
|
|
("l" spacemacs/persp-perspectives :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("n" persp-next)
|
|
|
|
|
("N" persp-prev)
|
|
|
|
|
("o" spacemacs/select-custom-layout :exit t)
|
|
|
|
|
("p" persp-prev)
|
|
|
|
|
("r" persp-remove-buffer :exit t)
|
|
|
|
|
("R" spacemacs/layouts-ts-rename :exit t)
|
|
|
|
|
("s" persp-save-state-to-file :exit t)
|
|
|
|
|
("S" persp-save-to-file-by-names :exit t)
|
|
|
|
|
("t" persp-temporarily-display-buffer :exit t)
|
2016-03-30 18:29:55 +00:00
|
|
|
|
("w" spacemacs/workspaces-transient-state/body :exit t)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
("x" spacemacs/layouts-ts-kill)
|
|
|
|
|
("X" spacemacs/layouts-ts-kill-other :exit t))
|
|
|
|
|
(spacemacs/set-leader-keys "l" 'spacemacs/layouts-transient-state/body)
|
|
|
|
|
;; custom layouts
|
|
|
|
|
(spacemacs|define-custom-layout "@Spacemacs"
|
|
|
|
|
:binding "e"
|
|
|
|
|
:body
|
|
|
|
|
(spacemacs/find-dotfile)))
|
|
|
|
|
:config
|
|
|
|
|
(progn
|
2017-02-13 13:38:37 +00:00
|
|
|
|
(spacemacs|hide-lighter persp-mode)
|
2016-03-21 01:48:06 +00:00
|
|
|
|
(defadvice persp-activate (before spacemacs//save-toggle-layout activate)
|
|
|
|
|
(setq spacemacs--last-selected-layout persp-last-persp-name))
|
|
|
|
|
(add-hook 'persp-mode-hook 'spacemacs//layout-autosave)
|
2019-07-31 04:34:51 +00:00
|
|
|
|
(advice-add 'persp-load-state-from-file
|
|
|
|
|
:before 'spacemacs//layout-wait-for-modeline)
|
2018-03-08 17:16:46 +00:00
|
|
|
|
(when layouts-enable-local-variables
|
|
|
|
|
(advice-add 'persp-switch :before #'spacemacs//load-layout-local-vars))
|
2019-07-31 04:34:51 +00:00
|
|
|
|
(dolist (fn spacemacs-layouts-restricted-functions)
|
|
|
|
|
(advice-add fn
|
|
|
|
|
:around 'spacemacs-layouts//advice-with-persp-buffer-list))
|
2018-03-08 17:16:46 +00:00
|
|
|
|
(spacemacs/declare-prefix "b" "persp-buffers")
|
2016-03-21 01:48:06 +00:00
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
|
"ba" 'persp-add-buffer
|
2016-10-02 07:29:55 +00:00
|
|
|
|
"br" 'persp-remove-buffer))))
|
2016-03-21 01:48:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/post-init-spaceline ()
|
|
|
|
|
(setq spaceline-display-default-perspective
|
|
|
|
|
dotspacemacs-display-default-layout))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-19 10:52:08 +00:00
|
|
|
|
(defun spacemacs-layouts/init-counsel-projectile ()
|
|
|
|
|
(use-package counsel-projectile
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2019-11-24 07:53:19 +00:00
|
|
|
|
:init (spacemacs/set-leader-keys "pl" 'spacemacs/ivy-persp-switch-project)
|
|
|
|
|
:config (ivy-set-actions
|
|
|
|
|
'spacemacs/ivy-persp-switch-project
|
|
|
|
|
'(("d" spacemacs/ivy-switch-project-open-dired "dired")))))
|
2021-06-22 05:17:38 +00:00
|
|
|
|
|
|
|
|
|
(defun spacemacs-layouts/post-init-consult ()
|
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
|
"pl" 'spacemacs/compleseus-pers-switch-project))
|