From 42ff36914280a18230626f775d9da0487438e282 Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Thu, 8 Jul 2021 22:13:13 -0700 Subject: [PATCH] `SPC TAB N` binding (#5173) * Introduce `SPC TAB N` binding * Add vanilla Emacs binding --- modules/config/default/+emacs-bindings.el | 1 + modules/config/default/+evil-bindings.el | 1 + modules/ui/workspaces/autoload/workspaces.el | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 7820f54bf..74f11e4b2 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -365,6 +365,7 @@ :desc "Display workspaces" "d" #'+workspace/display :desc "Rename workspace" "r" #'+workspace/rename :desc "Create workspace" "c" #'+workspace/new + :desc "Create named workspace" "C" #'+workspace/new-named :desc "Delete workspace" "k" #'+workspace/delete :desc "Save workspace" "S" #'+workspace/save :desc "Switch to other workspace" "o" #'+workspace/other diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index ff8728650..16d07c02a 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -306,6 +306,7 @@ :desc "Switch workspace" "." #'+workspace/switch-to :desc "Switch to last workspace" "`" #'+workspace/other :desc "New workspace" "n" #'+workspace/new + :desc "New named workspace" "N" #'+workspace/new-named :desc "Load workspace from file" "l" #'+workspace/load :desc "Save workspace to file" "s" #'+workspace/save :desc "Delete session" "x" #'+workspace/kill-session diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index f43fd4ac7..1beabbb60 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -306,6 +306,12 @@ workspace, otherwise the new workspace is blank." (+workspace/display))) ((debug error) (+workspace-error (cadr e) t)))) +;;;###autoload +(defun +workspace/new-named (name) + "Create a new workspace with a given NAME." + (interactive "sWorkspace Name: ") + (+workspace/new name)) + ;;;###autoload (defun +workspace/switch-to (index) "Switch to a workspace at a given INDEX. A negative number will start from the