Skip to content

Instantly share code, notes, and snippets.

@carlwoodward
Created October 4, 2014 08:55
Show Gist options
  • Save carlwoodward/52c3aa95a4ab99f0c495 to your computer and use it in GitHub Desktop.
Save carlwoodward/52c3aa95a4ab99f0c495 to your computer and use it in GitHub Desktop.
function! SelectaBuffers()
let bufcount = bufnr('$')
let buflist = []
for bufnum in range(1, bufcount)
let bufname = bufname(bufnum)
if !(bufname =~ '^fugitive://') && !(bufname =~ '^/') && !(bufname =~ '^\.')
call add(buflist, bufname)
endif
endfor
call system("> .bufferlist")
call writefile(buflist, ".bufferlist")
call SelectaCommand("cat `pwd`/.bufferlist | grep -v '^$' | sort -u", "", ":e")
endfunction
nnoremap <leader>b :call SelectaBuffers()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment