From 2bbdd1b556fd7c801622f06e6df09c08b211f857 Mon Sep 17 00:00:00 2001 From: Diego Berrocal Date: Thu, 14 Jan 2016 16:05:53 -0500 Subject: [PATCH] Add bindings for workspaces and layouts C-tab C-S-tab for workspaces (like tabs [vim tabs?]) C-s-tab C-S-s-tab for layouts (using super key like a WM) Also ( M-s- | C-s ) + [0-9] to change to number [0-9] workspace/layout --- .../+window-management/eyebrowse/README.org | 41 ++++++------- .../+window-management/eyebrowse/packages.el | 18 ++++++ .../spacemacs-layouts/README.org | 57 +++++++++++-------- .../spacemacs-layouts/packages.el | 19 +++++++ 4 files changed, 92 insertions(+), 43 deletions(-) diff --git a/layers/+window-management/eyebrowse/README.org b/layers/+window-management/eyebrowse/README.org index 501930fa5129..1f72b737020a 100644 --- a/layers/+window-management/eyebrowse/README.org +++ b/layers/+window-management/eyebrowse/README.org @@ -48,23 +48,26 @@ Set the variable =eyebrowse-display-help= to =nil= * Key bindings -| Key Binding | Description | -|-------------------------------------------+------------------------------------| -| ~gt~ | go to next workspace | -| ~gT~ | got to previous workspace | -| ~SPC l w 1~ | create or switch to workspace 1 | -| ~SPC l w 2~ | create or switch to workspace 2 | -| ~SPC l w 3~ | create or switch to workspace 3 | -| ~SPC l w 4~ | create or switch to workspace 4 | -| ~SPC l w 5~ | create or switch to workspace 5 | -| ~SPC l w 6~ | create or switch to workspace 6 | -| ~SPC l w 7~ | create or switch to workspace 7 | -| ~SPC l w 8~ | create or switch to workspace 8 | -| ~SPC l w 9~ | create or switch to workspace 9 | -| ~SPC l w 0~ | create or switch to workspace 0 | -| ~SPC l w TAB~ | switch to last active workspace | -| ~SPC l w c~ | close current workspace | -| ~SPC l w n~ or ~SPC l w l~ | switch to next workspace | +| Key Binding | Description | +|-------------------------------------+------------------------------------| +| ~gt~ | go to next workspace | +| ~gT~ | got to previous workspace | +| ~SPC l w 1~ | create or switch to workspace 1 | +| ~SPC l w 2~ | create or switch to workspace 2 | +| ~SPC l w 3~ | create or switch to workspace 3 | +| ~SPC l w 4~ | create or switch to workspace 4 | +| ~SPC l w 5~ | create or switch to workspace 5 | +| ~SPC l w 6~ | create or switch to workspace 6 | +| ~SPC l w 7~ | create or switch to workspace 7 | +| ~SPC l w 8~ | create or switch to workspace 8 | +| ~SPC l w 9~ | create or switch to workspace 9 | +| ~SPC l w 0~ | create or switch to workspace 0 | +| ~SPC l w TAB~ | switch to last active workspace | +| ~SPC l w c~ | close current workspace | +| ~SPC l w n~ or ~SPC l w l~ | switch to next workspace | | ~SPC l w N~ or ~SPC l w p~ or ~SPC l w h~ | switch to previous workspace | -| ~SPC l w r~ | set a tag to the current workspace | -| ~SPC l w w~ | switched to tagged workspace | +| ~SPC l w r~ | set a tag to the current workspace | +| ~SPC l w w~ | switched to tagged workspace | +| ~Control+Tab~ | Switch to next layout | +| ~Control+Shift+Tab~ | Switch to previous layout | +| ~Meta+Super+[0-9]~ | Switch to [0-9]th layout | diff --git a/layers/+window-management/eyebrowse/packages.el b/layers/+window-management/eyebrowse/packages.el index e15deb16d177..279bd7a45094 100644 --- a/layers/+window-management/eyebrowse/packages.el +++ b/layers/+window-management/eyebrowse/packages.el @@ -59,6 +59,24 @@ "[n] next, [p/N] previous, [TAB] back and forth, [c] close, " "[r] rename")))))) + (global-set-key (kbd "") + 'spacemacs//workspaces-eyebrowse-next-window-config-l) + (global-set-key (kbd "") + 'spacemacs//workspaces-eyebrowse-prev-window-config-h) + (global-set-key (kbd "") + 'spacemacs//workspaces-eyebrowse-prev-window-config-h) + + (global-set-key (kbd "M-s-1") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-1-1) + (global-set-key (kbd "M-s-2") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-2-2) + (global-set-key (kbd "M-s-3") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-3-3) + (global-set-key (kbd "M-s-4") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-4-4) + (global-set-key (kbd "M-s-5") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-5-5) + (global-set-key (kbd "M-s-6") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-6-6) + (global-set-key (kbd "M-s-7") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-7-7) + (global-set-key (kbd "M-s-8") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-8-8) + (global-set-key (kbd "M-s-9") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-9-9) + (global-set-key (kbd "M-s-0") 'spacemacs//workspaces-eyebrowse-switch-to-window-config-0-0) + (spacemacs|define-micro-state workspaces :doc (spacemacs//workspaces-ms-documentation) :use-minibuffer t diff --git a/layers/+window-management/spacemacs-layouts/README.org b/layers/+window-management/spacemacs-layouts/README.org index 7e64b68e5943..8327e1fb7e5c 100644 --- a/layers/+window-management/spacemacs-layouts/README.org +++ b/layers/+window-management/spacemacs-layouts/README.org @@ -5,7 +5,7 @@ - [[Description][Description]] - [[Install][Install]] - [[Layer][Layer]] - - [[Features ][Features ]] + - [[Features][Features]] - [[Micro-states][Micro-states]] - [[Layouts Micro State][Layouts Micro State]] - [[Project Layouts][Project Layouts]] @@ -16,6 +16,7 @@ - [[Predefined custom layouts][Predefined custom layouts]] - [[Org-agenda custom layout][Org-agenda custom layout]] - [[RCIRC/ERC custom layout][RCIRC/ERC custom layout]] + - [[Key bindings][Key bindings]] * Description This contribution layer adds layouts support to Spacemacs thanks to =persp-mode=. @@ -37,29 +38,29 @@ The layouts micro-state is initiated with ~SPC l~. | Key Binding | Description | |-------------+------------------------------------------------------------| -| ~?~ | toggle the documentation | -| ~[1..9, 0]~ | switch to nth layout | -| ~~ | switch to the latest layout | -| ~a~ | add a buffer to the current layout | -| ~A~ | add all the buffers from another layout in the current one | -| ~b~ | select a buffer in the current layout | -| ~c~ | close the current layout and keep its buffers | -| ~C~ | close the other layouts and keep their buffers | -| ~h~ | go to default layout | -| ~C-h~ | previous layout in list | -| ~l~ | select a layout with helm | -| ~L~ | load layouts from file | -| ~C-l~ | next layout in list | -| ~n~ | next layout in list | -| ~N~ | previous layout in list | -| ~o~ | open a custom layout | -| ~p~ | previous layout in list | -| ~r~ | remove current buffer from layout | -| ~R~ | rename layout | -| ~s~ | save layouts | -| ~t~ | display a buffer without adding it to the current layout | -| ~x~ | kill current layout with its buffers | -| ~X~ | kill other layouts with their buffers | +| ~?~ | toggle the documentation | +| ~[1..9, 0]~ | switch to nth layout | +| ~~ | switch to the latest layout | +| ~a~ | add a buffer to the current layout | +| ~A~ | add all the buffers from another layout in the current one | +| ~b~ | select a buffer in the current layout | +| ~c~ | close the current layout and keep its buffers | +| ~C~ | close the other layouts and keep their buffers | +| ~h~ | go to default layout | +| ~C-h~ | previous layout in list | +| ~l~ | select a layout with helm | +| ~L~ | load layouts from file | +| ~C-l~ | next layout in list | +| ~n~ | next layout in list | +| ~N~ | previous layout in list | +| ~o~ | open a custom layout | +| ~p~ | previous layout in list | +| ~r~ | remove current buffer from layout | +| ~R~ | rename layout | +| ~s~ | save layouts | +| ~t~ | display a buffer without adding it to the current layout | +| ~x~ | kill current layout with its buffers | +| ~X~ | kill other layouts with their buffers | *** Project Layouts To create a layout for a specific project use ~SPC p l~. @@ -140,3 +141,11 @@ you have and show them in a single buffer. (in evil the command starts with ~;a~ *** RCIRC/ERC custom layout Now you can also open IRC in a new layout to keep all the chat buffers in one layout isolated from your work buffers. + +* Key bindings + +| Key Binding | Description | +|-------------------------+---------------------------| +| ~Control+Super+Tab~ | Switch to next layout | +| ~Control+Super+Shift+Tab~ | Switch to previous layout | +| ~Control+Super+[0-9]~ | Switch to [0-9]th layout | diff --git a/layers/+window-management/spacemacs-layouts/packages.el b/layers/+window-management/spacemacs-layouts/packages.el index 5df52b41bbb4..2923f93ccb56 100644 --- a/layers/+window-management/spacemacs-layouts/packages.el +++ b/layers/+window-management/spacemacs-layouts/packages.el @@ -114,6 +114,25 @@ (when (equal 1 spacemacs--layouts-ms-doc-toggle) spacemacs--layouts-ms-documentation)))) + + (global-set-key (kbd "") + 'spacemacs//layouts-persp-next-n) + (global-set-key (kbd "") + 'spacemacs//layouts-persp-prev-p) + (global-set-key (kbd "") + 'spacemacs//layouts-persp-prev-p) + + (global-set-key (kbd "C-s-1") 'spacemacs//layouts-spacemacs/persp-switch-to-1-1) + (global-set-key (kbd "C-s-2") 'spacemacs//layouts-spacemacs/persp-switch-to-2-2) + (global-set-key (kbd "C-s-3") 'spacemacs//layouts-spacemacs/persp-switch-to-3-3) + (global-set-key (kbd "C-s-4") 'spacemacs//layouts-spacemacs/persp-switch-to-4-4) + (global-set-key (kbd "C-s-5") 'spacemacs//layouts-spacemacs/persp-switch-to-5-5) + (global-set-key (kbd "C-s-6") 'spacemacs//layouts-spacemacs/persp-switch-to-6-6) + (global-set-key (kbd "C-s-7") 'spacemacs//layouts-spacemacs/persp-switch-to-7-7) + (global-set-key (kbd "C-s-8") 'spacemacs//layouts-spacemacs/persp-switch-to-8-8) + (global-set-key (kbd "C-s-9") 'spacemacs//layouts-spacemacs/persp-switch-to-9-9) + (global-set-key (kbd "C-s-0") 'spacemacs//layouts-spacemacs/persp-switch-to-0-0) + (spacemacs|define-micro-state layouts :doc (spacemacs//layouts-ms-doc) :use-minibuffer t