mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Provide "." and "<C-R><C-G>" in blame buffers
This commit is contained in:
@@ -1142,7 +1142,7 @@ function! fugitive#Object(...) abort
|
|||||||
let rev = ''
|
let rev = ''
|
||||||
endif
|
endif
|
||||||
let tree = s:Tree(dir)
|
let tree = s:Tree(dir)
|
||||||
let full = a:0 ? a:1 : @%
|
let full = a:0 ? a:1 : s:BufName('%')
|
||||||
let full = fnamemodify(full, ':p' . (s:Slash(full) =~# '/$' ? '' : ':s?/$??'))
|
let full = fnamemodify(full, ':p' . (s:Slash(full) =~# '/$' ? '' : ':s?/$??'))
|
||||||
if empty(rev) && empty(tree)
|
if empty(rev) && empty(tree)
|
||||||
return FugitiveGitPath(full)
|
return FugitiveGitPath(full)
|
||||||
@@ -6043,6 +6043,7 @@ function! fugitive#BlameFileType() abort
|
|||||||
call s:Map('n', 'o', ':<C-U>exe <SID>BlameCommit("split")<CR>', '<silent>')
|
call s:Map('n', 'o', ':<C-U>exe <SID>BlameCommit("split")<CR>', '<silent>')
|
||||||
call s:Map('n', 'O', ':<C-U>exe <SID>BlameCommit("tabedit")<CR>', '<silent>')
|
call s:Map('n', 'O', ':<C-U>exe <SID>BlameCommit("tabedit")<CR>', '<silent>')
|
||||||
call s:Map('n', 'p', ':<C-U>exe <SID>BlameCommit("pedit")<CR>', '<silent>')
|
call s:Map('n', 'p', ':<C-U>exe <SID>BlameCommit("pedit")<CR>', '<silent>')
|
||||||
|
call s:Map('n', '.', ":<C-U> <C-R>=substitute(<SID>BlameCommitFileLnum()[0],'^$','@','')<CR><Home>")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
augroup fugitive_blame
|
augroup fugitive_blame
|
||||||
|
|||||||
Reference in New Issue
Block a user