diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 00bbdd83c..4ed1b1f97 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -164,22 +164,22 @@ :desc "Save workspace" "S" #'+workspace/save :desc "Load session" "l" #'doom/load-session :desc "Load last autosaved session" "L" #'doom/quickload-session - :desc "Kill other buffers" "o" #'doom/kill-other-buffers + :desc "Switch to other workspace" "o" #'+workspace/other :desc "Undo window config" "u" #'winner-undo :desc "Redo window config" "U" #'winner-redo :desc "Switch to left workspace" "p" #'+workspace/switch-left :desc "Switch to right workspace" "n" #'+workspace/switch-right :desc "Switch to" "w" #'+workspace/switch-to - :desc "Switch to workspace 1" "1" (λ! (+workspace/switch-to 0)) - :desc "Switch to workspace 2" "2" (λ! (+workspace/switch-to 1)) - :desc "Switch to workspace 3" "3" (λ! (+workspace/switch-to 2)) - :desc "Switch to workspace 4" "4" (λ! (+workspace/switch-to 3)) - :desc "Switch to workspace 5" "5" (λ! (+workspace/switch-to 4)) - :desc "Switch to workspace 6" "6" (λ! (+workspace/switch-to 5)) - :desc "Switch to workspace 7" "7" (λ! (+workspace/switch-to 6)) - :desc "Switch to workspace 8" "8" (λ! (+workspace/switch-to 7)) - :desc "Switch to workspace 9" "9" (λ! (+workspace/switch-to 8)) - :desc "Switch to last workspace" "0" #'+workspace/switch-to-last) + :desc "Switch to workspace 1" "1" #'+workspace/switch-to-0 + :desc "Switch to workspace 2" "2" #'+workspace/switch-to-1 + :desc "Switch to workspace 3" "3" #'+workspace/switch-to-2 + :desc "Switch to workspace 4" "4" #'+workspace/switch-to-3 + :desc "Switch to workspace 5" "5" #'+workspace/switch-to-4 + :desc "Switch to workspace 6" "6" #'+workspace/switch-to-5 + :desc "Switch to workspace 7" "7" #'+workspace/switch-to-6 + :desc "Switch to workspace 8" "8" #'+workspace/switch-to-7 + :desc "Switch to workspace 9" "9" #'+workspace/switch-to-8 + :desc "Switch to last workspace" "0" #'+workspace/switch-to-final) ;;; m --- multiple cursors (:when (featurep! :editor multiple-cursors) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index fd439b291..ec702b3cb 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -321,7 +321,7 @@ :g "M-7" (λ! (+workspace/switch-to 6)) :g "M-8" (λ! (+workspace/switch-to 7)) :g "M-9" (λ! (+workspace/switch-to 8)) - :g "M-0" #'+workspace/switch-to-last + :g "M-0" #'+workspace/switch-to-final :g "M-t" #'+workspace/new :g "M-T" #'+workspace/display)) @@ -530,6 +530,7 @@ (:prefix-map ("TAB" . "workspace") :desc "Display tab bar" "TAB" #'+workspace/display :desc "Switch workspace" "." #'+workspace/switch-to + :desc "Switch to last workspace" "`" #'+workspace/other :desc "New workspace" "n" #'+workspace/new :desc "Load workspace from file" "l" #'+workspace/load :desc "Save workspace to file" "s" #'+workspace/save @@ -539,16 +540,16 @@ :desc "Restore last session" "R" #'+workspace/restore-last-session :desc "Next workspace" "]" #'+workspace/switch-right :desc "Previous workspace" "[" #'+workspace/switch-left - :desc "Switch to 1st workspace" "1" (λ! (+workspace/switch-to 0)) - :desc "Switch to 2nd workspace" "2" (λ! (+workspace/switch-to 1)) - :desc "Switch to 3rd workspace" "3" (λ! (+workspace/switch-to 2)) - :desc "Switch to 4th workspace" "4" (λ! (+workspace/switch-to 3)) - :desc "Switch to 5th workspace" "5" (λ! (+workspace/switch-to 4)) - :desc "Switch to 6th workspace" "6" (λ! (+workspace/switch-to 5)) - :desc "Switch to 7th workspace" "7" (λ! (+workspace/switch-to 6)) - :desc "Switch to 8th workspace" "8" (λ! (+workspace/switch-to 7)) - :desc "Switch to 9th workspace" "9" (λ! (+workspace/switch-to 8)) - :desc "Switch to last workspace" "0" #'+workspace/switch-to-last)) + :desc "Switch to 1st workspace" "1" #'+workspace/switch-to-0 + :desc "Switch to 2nd workspace" "2" #'+workspace/switch-to-1 + :desc "Switch to 3rd workspace" "3" #'+workspace/switch-to-2 + :desc "Switch to 4th workspace" "4" #'+workspace/switch-to-3 + :desc "Switch to 5th workspace" "5" #'+workspace/switch-to-4 + :desc "Switch to 6th workspace" "6" #'+workspace/switch-to-5 + :desc "Switch to 7th workspace" "7" #'+workspace/switch-to-6 + :desc "Switch to 8th workspace" "8" #'+workspace/switch-to-7 + :desc "Switch to 9th workspace" "9" #'+workspace/switch-to-8 + :desc "Switch to final workspace" "0" #'+workspace/switch-to-final)) ;;; b --- buffer (:prefix-map ("b" . "buffer") diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index 585f02a17..e19c04d62 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -327,11 +327,22 @@ end of the workspace list." ('error (+workspace-error (cadr ex) t)))) ;;;###autoload -(defun +workspace/switch-to-last () - "Switch to the last workspace." +(dotimes (i 9) + (fset (intern (format "+workspace/switch-to-%d" i)) + (lambda () (interactive) (+workspace/switch-to i)))) + +;;;###autoload +(defun +workspace/switch-to-final () + "Switch to the final workspace in open workspaces." (interactive) (+workspace/switch-to (car (last (+workspace-list-names))))) +;;;###autoload +(defun +workspace/other () + "Switch to the last activated workspace." + (interactive) + (+workspace/switch-to +workspace--last)) + ;;;###autoload (defun +workspace/cycle (n) "Cycle n workspaces to the right (default) or left."