dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

delete_hidden_buffers.vim (349B)


      1 function! delete_hidden_buffers#DeleteHiddenBuffers() " Vim with the 'hidden' option
      2   if &hidden
      3     let tpbl=[]
      4     call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
      5     for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
      6       silent execute 'bwipeout' buf
      7     endfor
      8   endif
      9 endfunction