diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-06-19 11:32:02 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-06-19 11:32:02 +0100 |
commit | b875074a32fba5bbf19bfbe61fb9e4d06faf44a5 (patch) | |
tree | 702920df497ccb6ea01c090f2b4357c144535312 /.emacs.d/lisp/init-project.el | |
parent | b317bdf991d77c34dabc0cf7a34f1dc73039e558 (diff) | |
download | dotfiles-b875074a32fba5bbf19bfbe61fb9e4d06faf44a5.tar.gz |
Replace crux-switch-to-previous-buffer with a persp-aware version
Diffstat (limited to '.emacs.d/lisp/init-project.el')
-rw-r--r-- | .emacs.d/lisp/init-project.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-project.el b/.emacs.d/lisp/init-project.el index 2229eeb..3e847da 100644 --- a/.emacs.d/lisp/init-project.el +++ b/.emacs.d/lisp/init-project.el @@ -102,6 +102,11 @@ mode as the current buffer (or do nothing)." "Variant of persp-previous-buffer-same-mode, which opens in other window." (interactive) (persp-previous-buffer-same-mode #'switch-to-buffer-other-window)) + ;; Inspired by crux-switch-to-previous-buffer + (defun persp-switch-to-previous-buffer () + "Switch to the previous buffer in the current perspective." + (interactive) + (switch-to-buffer (persp-other-buffer (current-buffer) 1))) (defun persp-current-project-root () "Return the current project root, falling back to finding it by the perpsective" (if-let (project (project-current)) @@ -131,6 +136,7 @@ mode as the current buffer (or do nothing)." :bind ("C-x p p" . switch-project) + ("C-c C-M-j" . persp-switch-to-previous-buffer) ("C-x C-b" . persp-previous-buffer-same-mode) ("C-x 4 C-b" . persp-previous-buffer-same-mode-other-window) ("C-x C-S-b" . persp-switch-buffer-same-mode) |