Add FugitiveFilename() to determine corresponding real file

This commit is contained in:
Tim Pope
2018-06-05 12:28:16 -04:00
parent b571bff9ec
commit cc9d8d93c8
2 changed files with 36 additions and 0 deletions

View File

@@ -138,6 +138,15 @@ function! FugitiveHead(...) abort
return fugitive#repo().head(a:0 ? a:1 : 0)
endfunction
function! FugitiveFilename(...) abort
let file = fnamemodify(a:0 ? a:1 : @%, ':p')
if file =~? '^fugitive:'
return fugitive#Filename(file)
else
return file
endif
endfunction
augroup fugitive
autocmd!