Skip to content

Instantly share code, notes, and snippets.

@statianzo
Last active August 14, 2017 22:07
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 statianzo/0b8d172bfbe832dded428db8d6765a1a to your computer and use it in GitHub Desktop.
Save statianzo/0b8d172bfbe832dded428db8d6765a1a to your computer and use it in GitHub Desktop.
View the history of selected lines in git
function! GitLineHistory() range
exec ":vs | te git log -L '" . a:firstline . "," . a:lastline . ":%'"
endfunction
command! -range GitLineHistory <line1>,<line2>call GitLineHistory()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment