mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] add EditGlob function
This commit is contained in:
parent
3d856b1b3c
commit
e80379a2e5
1 changed files with 14 additions and 0 deletions
|
@ -91,6 +91,20 @@ nnoremap <silent><expr> <CR> &buftype is# '' ? ":write<bar>wall\<CR>" : "\<CR>"
|
||||||
command -nargs=* -complete=file Open call s:Open(empty(<q-args>) ? expand('%') : <q-args>)
|
command -nargs=* -complete=file Open call s:Open(empty(<q-args>) ? expand('%') : <q-args>)
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
" EditGlob {{{
|
||||||
|
" Yes, I know about the existence of :args, however it modifies the
|
||||||
|
" argument list, so it doesn't play well with Obsession.vim because it
|
||||||
|
" saves the argument list in the session file.
|
||||||
|
function s:EditGlob(...)
|
||||||
|
for l:glob in a:000
|
||||||
|
for l:name in glob(l:glob, 0, 1)
|
||||||
|
execute 'edit' fnameescape(l:name)
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
command -nargs=* -complete=file -bar EditGlob call s:EditGlob(<f-args>)
|
||||||
|
" }}}
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue