Comments
-
Greg Hurrell
I actually think the right place for this kind of functionality is just a simple mapping in your
~/.vimrc
. For example, this is what I have in mine for this purpose:map <leader>da :bufdo silent! bdelete<CR>
I hit
<leader>da
(in my case, I have the comma key as my leader, so,da
); mnemonic: "delete all". This deletes all buffers, except those with unsaved changes. I just hit this if the buffer listing starts to become unmanageably large. -
Greg Hurrell
Going to mark this as closed. You're welcome to submit a patch if you'd like and I'll consider it.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
-
anonymous
I tend to agree with the original poster and was looking for this functionality today... I would like to just highlight the buffer and press something like <C-d> and have that buffer gets closed. I don't want to just close all buffers like you suggest. Right now, I have to do a <C-t> to open in a new tab, then :bd to kill the buffer. Would be great if this were just one keystroke.
-
DaveSanders
Howdy, I just about have this implemented, however, only having been using VIM for a week, I have an issue with it that I don't know how to fix:
I have hooked it in so that you have a new option to "DeleteBuffer", which I have mapped via <C-d> After playing with it, it works great, but if you delete the last buffer, C-T wigs out because it can't close. (Which makes sense.) Also the screen gets unpredictable if you close a buffer that was the screen that you opened C-T on. (C-T jumps to the top of the screen.
Playing with the code I can't figure out how to know if the buffer I'm deleting is in the current window that C-T popped up in. If I could figure that out then I could probably pop a :new in the place of the buffer I'm deleting.
I tried putting in a :new before every buffer delete just to see what it would do, and unfortunately it made the :new really short and C-T still bounced to the top. So it needs to start a :new and then make it fill the space.
I can try to pull together a patch of what I have so far (it's really minor) and maybe you could either handle the window issue with your expertise, or give me a hint on how to solve it myself? I'm at a loss because I don't know how to debug and see what variables are available in the ruby while its executing, so if you could give me an idea on that, I could probably figure it out...
thanks for a great tool!
-
urandom
Hi, the link is a patch that implements this feature. It seems to work, but I have absolutely no knowledge of ruby, so someone should look at it as well
-
anonymous
Thank you Dave! Your patch is working great here.
-
anonymous
Hey Wincent, Would you entertain a Git Pull Request for this feature? PS Thanks for command-t!
-
Greg Hurrell
Sure.
Add a comment
Comments are now closed for this issue.