From e1a29072eba6526734bd1d0a6079c0a7cf858b03 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 31 Aug 2025 18:09:14 -0500 Subject: [PATCH] More scratch buffer functions --- modules/user/emacs/init.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/user/emacs/init.el b/modules/user/emacs/init.el index 6758d3f8..bf8cc2c9 100644 --- a/modules/user/emacs/init.el +++ b/modules/user/emacs/init.el @@ -244,8 +244,30 @@ (progn (select-window (scratch-plus-switch nil))))) + (defun scratch-plus-only () + (interactive) + (if (projectile-project-p) + (progn + (select-window (scratch-plus-switch-project nil))) + (progn + (select-window (scratch-plus-switch nil)))) + (delete-other-windows)) + + (defun scratch-plus-main-toggle () + (interactive) + (select-window (scratch-plus-switch nil))) + + + (defun scratch-plus-main-only () + (interactive) + (select-window (scratch-plus-switch nil)) + (delete-other-windows)) + ;; File and buffer keybinds (evil-define-key 'motion 'global (kbd "x") 'scratch-plus-toggle) + (evil-define-key 'motion 'global (kbd "X") 'scratch-plus-main-toggle) + (evil-define-key 'motion 'global (kbd "z") 'scratch-plus-only) + (evil-define-key 'motion 'global (kbd "Z") 'scratch-plus-main-only) (evil-define-key 'motion 'global (kbd ".") 'find-file) (evil-define-key 'motion 'global (kbd "bi") 'ibuffer) (evil-define-key 'motion 'global (kbd "bd") 'evil-delete-buffer)