spacemacs layouts and workspaces tweaks
- add `l` to workspace transient state to go back to layout transient state - remove erroneous `l` and `h` keys on layouts transient state - unique documentation toggle for layouts and workspaces - reformat and sort transient states documentation
This commit is contained in:
parent
91eeccc7a5
commit
c4d9ca8fba
|
@ -21,11 +21,8 @@
|
||||||
(defvar layouts-autosave-delay 900
|
(defvar layouts-autosave-delay 900
|
||||||
"Delay in seconds between each layouts auto-save.")
|
"Delay in seconds between each layouts auto-save.")
|
||||||
|
|
||||||
(defvar spacemacs--layouts-ts-full-hint-toggle 0
|
(defvar spacemacs--ts-full-hint-toggle 0
|
||||||
"Display a short doc when nil, full doc otherwise.")
|
"Toggle display of transient states documentations.")
|
||||||
|
|
||||||
(defvar spacemacs--workspaces-ts-full-hint-toggle 0
|
|
||||||
"Display a short doc when nil, full doc otherwise.")
|
|
||||||
|
|
||||||
(defvar spacemacs--last-selected-layout dotspacemacs-default-layout-name
|
(defvar spacemacs--last-selected-layout dotspacemacs-default-layout-name
|
||||||
"Previously selected layout.")
|
"Previously selected layout.")
|
||||||
|
|
|
@ -61,8 +61,8 @@ current perspective."
|
||||||
(defun spacemacs//layouts-ts-toggle-hint ()
|
(defun spacemacs//layouts-ts-toggle-hint ()
|
||||||
"Toggle the full hint docstring for the layouts transient-state."
|
"Toggle the full hint docstring for the layouts transient-state."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq spacemacs--layouts-ts-full-hint-toggle
|
(setq spacemacs--ts-full-hint-toggle
|
||||||
(logxor spacemacs--layouts-ts-full-hint-toggle 1)))
|
(logxor spacemacs--ts-full-hint-toggle 1)))
|
||||||
|
|
||||||
(defun spacemacs//layout-format-name (name pos)
|
(defun spacemacs//layout-format-name (name pos)
|
||||||
"Format the layout name given by NAME for display in mode-line."
|
"Format the layout name given by NAME for display in mode-line."
|
||||||
|
@ -89,7 +89,7 @@ current perspective."
|
||||||
persp-list " | "))))
|
persp-list " | "))))
|
||||||
(concat
|
(concat
|
||||||
formatted-persp-list
|
formatted-persp-list
|
||||||
(if (equal 1 spacemacs--layouts-ts-full-hint-toggle)
|
(if (equal 1 spacemacs--ts-full-hint-toggle)
|
||||||
spacemacs--layouts-ts-full-hint
|
spacemacs--layouts-ts-full-hint
|
||||||
(concat " (["
|
(concat " (["
|
||||||
(propertize "?" 'face 'hydra-face-red)
|
(propertize "?" 'face 'hydra-face-red)
|
||||||
|
@ -456,8 +456,8 @@ STATE is a window-state object as returned by `window-state-get'."
|
||||||
(defun spacemacs//workspaces-ts-toggle-hint ()
|
(defun spacemacs//workspaces-ts-toggle-hint ()
|
||||||
"Toggle the full hint docstring for the workspaces transient-state."
|
"Toggle the full hint docstring for the workspaces transient-state."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq spacemacs--workspaces-ts-full-hint-toggle
|
(setq spacemacs--ts-full-hint-toggle
|
||||||
(logxor spacemacs--workspaces-ts-full-hint-toggle 1)))
|
(logxor spacemacs--ts-full-hint-toggle 1)))
|
||||||
|
|
||||||
(defun spacemacs/workspaces-ts-rename ()
|
(defun spacemacs/workspaces-ts-rename ()
|
||||||
"Rename a workspace and get back to transient-state."
|
"Rename a workspace and get back to transient-state."
|
||||||
|
@ -483,7 +483,7 @@ STATE is a window-state object as returned by `window-state-get'."
|
||||||
" "
|
" "
|
||||||
(mapconcat 'spacemacs//workspace-format-name
|
(mapconcat 'spacemacs//workspace-format-name
|
||||||
(eyebrowse--get 'window-configs) " | ")
|
(eyebrowse--get 'window-configs) " | ")
|
||||||
(if (equal 1 spacemacs--workspaces-ts-full-hint-toggle)
|
(if (equal 1 spacemacs--ts-full-hint-toggle)
|
||||||
spacemacs--workspaces-ts-full-hint
|
spacemacs--workspaces-ts-full-hint
|
||||||
(concat " (["
|
(concat " (["
|
||||||
(propertize "?" 'face 'hydra-face-red)
|
(propertize "?" 'face 'hydra-face-red)
|
||||||
|
@ -531,10 +531,3 @@ FRAME defaults to the current frame."
|
||||||
'eyebrowse-current-slot (eyebrowse--get 'current-slot frame) persp)
|
'eyebrowse-current-slot (eyebrowse--get 'current-slot frame) persp)
|
||||||
(set-persp-parameter
|
(set-persp-parameter
|
||||||
'eyebrowse-last-slot (eyebrowse--get 'last-slot frame) persp)))
|
'eyebrowse-last-slot (eyebrowse--get 'last-slot frame) persp)))
|
||||||
|
|
||||||
(defun spacemacs/layout-workspaces-transient-state ()
|
|
||||||
"Launches the workspaces transient state, if defined."
|
|
||||||
(interactive)
|
|
||||||
(if (fboundp 'spacemacs/workspaces-transient-state/body)
|
|
||||||
(call-interactively 'spacemacs/workspaces-transient-state/body)
|
|
||||||
(message "You need the eyebrowse layer to use this feature.")))
|
|
||||||
|
|
|
@ -32,13 +32,14 @@
|
||||||
(spacemacs|transient-state-format-hint workspaces
|
(spacemacs|transient-state-format-hint workspaces
|
||||||
spacemacs--workspaces-ts-full-hint
|
spacemacs--workspaces-ts-full-hint
|
||||||
"\n\n
|
"\n\n
|
||||||
Go to^^^^^^ Remove/Rename...^^
|
Go to^^^^^^ Actions^^
|
||||||
--^-^--^^^^----------------------- --^-^---------------------------
|
─────^^^^^^─────────────────────── ───────^^──────────────────────
|
||||||
[_0_,_9_]^^ nth/new workspace [_d_] close current workspace
|
[_0_,_9_]^^ nth/new workspace [_d_] close current workspace
|
||||||
[_C-0_,_C-9_]^^ nth/new workspace [_R_] rename current workspace
|
[_C-0_,_C-9_]^^ nth/new workspace [_R_] rename current workspace
|
||||||
|
[_<tab>_]^^^^ last workspace [_?_] toggle help\n
|
||||||
|
[_l_]^^^^ layouts
|
||||||
[_n_/_C-l_]^^ next workspace
|
[_n_/_C-l_]^^ next workspace
|
||||||
[_N_/_p_/_C-h_] prev workspace
|
[_N_/_p_/_C-h_] prev workspace\n")
|
||||||
[_<tab>_]^^^^ last workspace\n")
|
|
||||||
|
|
||||||
(spacemacs|define-transient-state workspaces
|
(spacemacs|define-transient-state workspaces
|
||||||
:title "Workspaces Transient State"
|
:title "Workspaces Transient State"
|
||||||
|
@ -71,8 +72,7 @@
|
||||||
("C-i" eyebrowse-last-window-config)
|
("C-i" eyebrowse-last-window-config)
|
||||||
("C-l" eyebrowse-next-window-config)
|
("C-l" eyebrowse-next-window-config)
|
||||||
("d" eyebrowse-close-window-config)
|
("d" eyebrowse-close-window-config)
|
||||||
("h" eyebrowse-prev-window-config)
|
("l" spacemacs/layouts-transient-state/body :exit t)
|
||||||
("l" eyebrowse-next-window-config)
|
|
||||||
("n" eyebrowse-next-window-config)
|
("n" eyebrowse-next-window-config)
|
||||||
("N" eyebrowse-prev-window-config)
|
("N" eyebrowse-prev-window-config)
|
||||||
("p" eyebrowse-prev-window-config)
|
("p" eyebrowse-prev-window-config)
|
||||||
|
@ -118,23 +118,19 @@
|
||||||
(spacemacs|transient-state-format-hint layouts
|
(spacemacs|transient-state-format-hint layouts
|
||||||
spacemacs--layouts-ts-full-hint
|
spacemacs--layouts-ts-full-hint
|
||||||
"\n\n
|
"\n\n
|
||||||
Go to^^^^^^ Add/Remove/Rename...^^
|
Go to^^^^^^ Actions^^
|
||||||
--^-^--^^^^----------------------- --^-^---------------------------
|
─────^^^^^^────────────────────────────── ───────^^──────────────────────────────────────────────────
|
||||||
[_b_]^^^^ buffer in layout [_a_] add buffer
|
[_0_,_9_]^^ nth/new layout [_a_]^^ add buffer
|
||||||
[_h_]^^^^ default layout [_A_] add all from layout
|
[_C-0_,_C-9_]^^ nth/new layout [_A_]^^ add all from layout
|
||||||
[_o_]^^^^ custom layout [_r_] remove current buffer
|
[_<tab>_]^^^^ last layout [_d_]^^ close current layout
|
||||||
[_l_]^^^^ layout w/helm/ivy [_d_] close current layout
|
[_b_]^^^^ buffer in layout [_D_]^^ close other layout
|
||||||
[_L_]^^^^ layouts in file [_D_] close other layout
|
[_h_]^^^^ default layout [_r_]^^ remove current buffer
|
||||||
[_0_,_9_]^^ nth/new layout [_x_] kill current w/buffers
|
[_l_]^^^^ layout w/helm/ivy [_R_]^^ rename current layout
|
||||||
[_C-0_,_C-9_]^^ nth/new layout [_X_] kill other w/buffers
|
[_L_]^^^^ layouts in file [_s_/_S_] save all layouts/save by names
|
||||||
[_n_/_C-l_]^^ next layout [_R_] rename current layout
|
[_n_/_C-l_]^^ next layout [_t_]^^ show a buffer without adding it to current layout
|
||||||
[_N_/_p_/_C-h_] prev layout
|
[_N_/_p_/_C-h_] prev layout [_x_]^^ kill current w/buffers
|
||||||
[_<tab>_]^^^^ last layout
|
[_o_]^^^^ custom layout [_X_]^^ kill other w/buffers
|
||||||
--^^^^^^^^----------------------------------------------------------
|
[_w_]^^^^ workspaces transient state [_?_]^^ toggle help\n")
|
||||||
[_s_/_S_] save all layouts/save by names
|
|
||||||
[_t_]^^ show a buffer without adding it to current layout
|
|
||||||
[_w_]^^ workspaces micro-state (requires eyebrowse layer)
|
|
||||||
[_?_]^^ toggle help\n")
|
|
||||||
|
|
||||||
(spacemacs|define-transient-state layouts
|
(spacemacs|define-transient-state layouts
|
||||||
:title "Layouts Transient State"
|
:title "Layouts Transient State"
|
||||||
|
@ -184,7 +180,7 @@
|
||||||
("s" persp-save-state-to-file :exit t)
|
("s" persp-save-state-to-file :exit t)
|
||||||
("S" persp-save-to-file-by-names :exit t)
|
("S" persp-save-to-file-by-names :exit t)
|
||||||
("t" persp-temporarily-display-buffer :exit t)
|
("t" persp-temporarily-display-buffer :exit t)
|
||||||
("w" spacemacs/layout-workspaces-transient-state :exit t)
|
("w" spacemacs/workspaces-transient-state/body :exit t)
|
||||||
("x" spacemacs/layouts-ts-kill)
|
("x" spacemacs/layouts-ts-kill)
|
||||||
("X" spacemacs/layouts-ts-kill-other :exit t))
|
("X" spacemacs/layouts-ts-kill-other :exit t))
|
||||||
(spacemacs/set-leader-keys "l" 'spacemacs/layouts-transient-state/body)
|
(spacemacs/set-leader-keys "l" 'spacemacs/layouts-transient-state/body)
|
||||||
|
|
Loading…
Reference in a new issue