Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I close all buffers but one in vim? I'm looking for an :only command, but for buffers. I've had trouble finding this using :help and :helpgrep, does anyone know if this exists? I know you can close multiple buffers with :bd some# other# etc.., but that's a bit slow

share|improve this question

1 Answer 1

up vote 2 down vote accepted

There is a plugin that will do what you want:

http://www.vim.org/scripts/script.php?script_id=1071

share|improve this answer
    
hmm, that looks alright, but doesn't seem to load with vim-unbundle, so I need to :source it manually. Do you know why? –  Josh Jun 7 '12 at 15:02
1  
I've never used unbundle so I'm not sure. But from what I read in the link you provided, unbundle looks for bundle directories. BufOnly is just a single .vim file. So :source it or just download it to your plugins directory. –  embedded.kyle Jun 7 '12 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.