2

Emacs 26.1. ido, smex

If I want to kill one buffer I use command C-x k

Here result: enter image description here

As result I can kill ONE desire buffer. But suppose I need to kill the next buffers:

build.gradle, approfile.json, cascade.update.txt

How I can do this quickly?

Drew
  • 75,699
  • 9
  • 109
  • 225
a_subscriber
  • 3,854
  • 1
  • 17
  • 47
  • 1
    In `ido`, you can kill buffers from `ido-switch-buffer` (`C-x b`) by typing `C-k` while you have the desired buffer as the suggestion. –  Nov 03 '18 at 17:15
  • It's very slow. I need by arrow to go to desire buffer and type C-k. What about if I need to delete 20 buffers with name suffix *.txt? – a_subscriber Nov 04 '18 at 08:29
  • 1
    You can narrow by typing the name of the buffer you want to switch to. –  Nov 04 '18 at 14:51

2 Answers2

2

ido isn't designed for that; use the buffer list instead. C-x C-b opens a buffer containing a list of all buffers that are open. In this buffer you can use C-k to mark buffers to be deleted, then x to delete all marked buffers. Since it's a full buffer, you can also use C-s to search it.

db48x
  • 15,741
  • 1
  • 19
  • 23
  • 1
    I'd suggest using `ibuffer` for that, as it allows to mark buffers like you'd do in `dired`, for instance by their file names or modes. –  Nov 04 '18 at 14:50
0

Another option which I find really handy is M-x kill-some-buffers. Really nice option no need for split screens or anything like that it uses the mini buffer keeping things tight, meaning that after the command is executed you won’t have to C-x o C-x k the remaining open buffer of ibuffer or the listed buffers C-x C-b

Kirk Walla
  • 219
  • 1
  • 8
  • It's ask me for every buffer. Smt like: Buffer "xxxx" is unmodified, Kill ? . So this is not what i need. – a_subscriber Oct 11 '19 at 11:36
  • Ok, its definitely up to your choice but you can silence that y/n predicate if you want. Also, if you already found some other solutions working better for you then there's no need to look at something else. Cheers! – Kirk Walla Oct 11 '19 at 11:57