Created
November 24, 2014 19:04
-
-
Save dsummersl/2b9faa9133322c33b465 to your computer and use it in GitHub Desktop.
:bda command to clear out hidden buffers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" delete all buffers function | |
function! DeleteHiddenBuffers() | |
let tpbl=[] | |
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))') | |
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1') | |
silent execute 'bwipeout' buf | |
endfor | |
endfunction | |
cabbrev bda call DeleteHiddenBuffers() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment