Skip to content

Instantly share code, notes, and snippets.

@AndrewVos

AndrewVos/.vimrc

Last active Aug 29, 2015
Embed
What would you like to do?
Use the :G <tab> command in vim to list files that have been modified in a git repository
if !empty(glob(".git"))
function! GitLsFilesModified(A,L,P)
let pattern = a:A
if len(pattern) > 0
return split(system("git ls-files --untracked --modified \| grep " . pattern), "\n")
else
return split(system("git ls-files --untracked --modified"), "\n")
endif
endfunction
command! -complete=customlist,GitLsFilesModified -nargs=1 G :edit <args>
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.