Skip to content

Instantly share code, notes, and snippets.

@kentokento
Created October 8, 2014 13:30
Show Gist options
  • Save kentokento/e1d2ccf547f607de88a1 to your computer and use it in GitHub Desktop.
Save kentokento/e1d2ccf547f607de88a1 to your computer and use it in GitHub Desktop.
vimrc - vim起動中に選択した部分のみのgit blameを表示する
" 選択した範囲のgit blameを表示
" 選択した状態で :S (押しやすいから)
function! GitBlameOnLineAndFile() range
:execute printf(':!git blame -L %d,%d %s | cat', a:firstline, a:lastline, expand("%:p"))
endfunction
command! -range S :<line1>,<line2>call GitBlameOnLineAndFile()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment