diff options
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) |