diff --git a/flakes/emacs/config/init.el b/flakes/emacs/config/init.el index 09263a2..3ec0f0b 100644 --- a/flakes/emacs/config/init.el +++ b/flakes/emacs/config/init.el @@ -199,7 +199,16 @@ (use-package emacs :ensure nil :demand t - :bind (("" . ignore) + :preface + (defun to/toggle-delete-other-windows () + "Delete other windows, or restore the previous window configuration." + (interactive) + (if (and winner-mode + (one-window-p t)) + (winner-undo) + (delete-other-windows))) + :bind (("C-x 1" . to/toggle-delete-other-windows) + ("" . ignore) ("" . ignore) ("" . ignore)) :config