:GB
:7,13GB
:,+5GB
:?foo?,$GB
:'<,'>GB
:%GB
:GB
:7,13GB
:,+5GB
:?foo?,$GB
:'<,'>GB
:%GB
| command! -range GB echo join(systemlist("git -C " . shellescape(expand('%:p:h')) . " blame -L <line1>,<line2> " . expand('%:t')), "\n") |
@Konfect, fixed, thanks.
IDEA: make it possible to pass an optional argument:
:GB HEAD~6
This has been working well for me.
command! -nargs=? -range GB echo join(systemlist("git -C " . shellescape(expand('%:p:h')) . " blame -L <line1>,<line2> <args> -- " . expand('%:t')), "\n")
If
-C " . shellescape(expand('%:p:h'))is used, then correspondingly alsoexpand('%:t')instead of'%'.