Last active
December 31, 2015 07:39
-
-
Save sirbrillig/7955865 to your computer and use it in GitHub Desktop.
A vimL class to open a file list buffer.
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
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