From 0426b9d514a24d27784a80128fe25f0e50ac8315 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 7 Oct 2019 23:56:47 -0400 Subject: [PATCH] Create a jump point before kill-current-buffer So you can easily "undo" killing it. --- core/core-editor.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/core-editor.el b/core/core-editor.el index 4e34ae00e..b89566ce4 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -293,7 +293,12 @@ files, so we replace calls to `pp' with the much faster `prin1'." (defun doom-set-jump-h () "Run `better-jumper-set-jump' but return nil, for short-circuiting hooks." (better-jumper-set-jump) - nil)) + nil) + + ;; Creates a jump point before killing a buffer. This allows you to undo + ;; killing a buffer easily (only works with file buffers though; it's not + ;; possible to resurrect special buffers). + (advice-add #'kill-current-buffer :around #'doom-set-jump-a)) (use-package! dtrt-indent