A lesson for the less-informed: while using ido to switch buffers, you can kill buffers with C-k.
For some reason, though, you can't bury them. C-b seems like an obvious choice, but find your personal preference.
(add-hook 'ido-setup-hook (defun endless/define-ido-bury-key () (define-key ido-completion-map (kbd "C-b") 'endless/ido-bury-buffer-at-head))) (defun endless/ido-bury-buffer-at-head () "Bury the buffer at the head of `ido-matches'." (interactive) (let ((enable-recursive-minibuffers t) (buf (ido-name (car ido-matches))) (nextbuf (cadr ido-matches))) (when (get-buffer buf) ;; If next match names a buffer use the buffer object; ;; buffer name may be changed by packages such as ;; uniquify. (when (and nextbuf (get-buffer nextbuf)) (setq nextbuf (get-buffer nextbuf))) (bury-buffer buf) (if (bufferp nextbuf) (setq nextbuf (buffer-name nextbuf))) (setq ido-default-item nextbuf ido-text-init ido-text ido-exit 'refresh) (exit-minibuffer))))
Don't be overly impressed by the apparent robustness of the code, it's merely an adaptation of ido-kill-buffer-at-head.
ido-kill-buffer-at-head
Tags: lisp, init.el, emacs,
Ido Bury Buffer
30 Jun 2014, by Artur Malabarba.A lesson for the less-informed: while using ido to switch buffers, you can kill buffers with C-k.
For some reason, though, you can't bury them. C-b seems like an obvious choice, but find your personal preference.
Don't be overly impressed by the apparent robustness of the code, it's merely an adaptation of
ido-kill-buffer-at-head
.Tags: lisp, init.el, emacs,
Require Feature or Install Package »
« Meta Binds Part 1: Drunk in the Dark
Related Posts
Eval-result-overlays in Emacs-lisp in lisp
Define context-aware keys in Emacs in lisp
Using prettify-symbols in Clojure and Elisp without breaking indentation in lisp
Content © 2019, All rights reserved. Icons under CC3.0.