diff options
author | JSDurand <mmemmew@gmail.com> | 2021-01-21 23:52:21 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-01-22 00:01:20 +0800 |
commit | 588b6031e152b031be1dee04c7b38938ea7eb706 (patch) | |
tree | ed25c53f4e1ece59f97ecbff19cb2325bf01baf3 /ibuffer.el | |
parent | 53db9402916822e673b3b49fcba26537e2416b59 (diff) |
Regular updates
In the course of configuring Emacs there are numerous changes to make.
This is one regular step.
Diffstat (limited to 'ibuffer.el')
-rw-r--r-- | ibuffer.el | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -8,10 +8,34 @@ (setq ibuffer-show-empty-filter-groups nil) -;;; a temporary binding +;;; Bindings related to buffers + +;;;; Quickly switch to the last buffer. + +;;;###autoload +(defun durand-switch-to-last-buffer (&optional arg) + "Switch to the last buffer. + +The last buffer is given by `other-buffer'. + +If ARG is non-nil, then display the last buffer in a new window." + (interactive "P") + (cond + (arg (switch-to-buffer-other-window nil)) + ((switch-to-buffer nil)))) + +;;;###autoload +(defun durand-switch-to-last-buffer-other-window () + "Switch to the last buffer in a new window." + (interactive) + (switch-to-buffer-other-window nil)) (define-key global-map (vector 24 2) #'ibuffer) -(define-key global-map (vector ?\s-b) #'ibuffer) +(define-key global-map (vector ?\s-h) #'ibuffer) +(define-key global-map (vector ?\s-b) #'switch-to-buffer) +(define-key global-map (vector ?\s-B) #'switch-to-buffer-other-window) +(define-key global-map (vector ?\s-n) #'durand-switch-to-last-buffer) +(define-key global-map (vector ?\s-N) #'durand-switch-to-last-buffer-other-window) (define-key ibuffer-mode-map (vector ?d) #'ibuffer-do-delete) (define-key ibuffer-mode-map (vector ?D) #'ibuffer-mark-for-delete) |