Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Last active December 31, 2015 07:39
Show Gist options
  • Save sirbrillig/7955865 to your computer and use it in GitHub Desktop.
Save sirbrillig/7955865 to your computer and use it in GitHub Desktop.
A vimL class to open a file list buffer.
function! OpenQuickList(data)
silent! botright 10split __QuickList__
normal! ggdG
setlocal buftype=nofile
setlocal bufhidden=delete
setlocal noswapfile
setlocal nowrap
setlocal nobuflisted
call append(0, a:data)
nnoremap <buffer> <silent> <CR> :call OpenQuickListFile()<CR>
endfunction
function! OpenQuickListFile() range
let fnames = getline(a:firstline, a:lastline)
if len(fnames) <=# 0
return
endif
silent! close
for fname in fnames
if len(fname) ==# 0 || strpart(fname, 0, 1) ==# '#'
continue
endif
exe '999tabnew ' . fname
endfor
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment