Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created July 11, 2014 14:36
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/8611016babdfff191de4 to your computer and use it in GitHub Desktop.
Save AndrewVos/8611016babdfff191de4 to your computer and use it in GitHub Desktop.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment