Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created October 6, 2014 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/b221f846eef93ead54a2 to your computer and use it in GitHub Desktop.
Save AndrewVos/b221f846eef93ead54a2 to your computer and use it in GitHub Desktop.
if !empty(glob(".git"))
function! GitLsFiles(A,L,P)
let pattern = a:A
if len(pattern) > 0
return split(system("git ls-files \| grep " . pattern), "\n")
else
return split(system("git ls-files"), "\n")
endif
endfunction
command! -complete=customlist,GitLsFiles -nargs=1 Z :edit <args>
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment