mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-08 04:54:52 +08:00
Extract fugitiveblame ftplugin
References https://github.com/tpope/vim-fugitive/issues/1425
This commit is contained in:
@@ -5788,7 +5788,7 @@ function! s:BlameRehighlight() abort
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:BlameFileType() abort
|
function! fugitive#BlameFileType() abort
|
||||||
setlocal nomodeline
|
setlocal nomodeline
|
||||||
setlocal foldmethod=manual
|
setlocal foldmethod=manual
|
||||||
if len(s:Dir())
|
if len(s:Dir())
|
||||||
@@ -5821,7 +5821,6 @@ endfunction
|
|||||||
|
|
||||||
augroup fugitive_blame
|
augroup fugitive_blame
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType fugitiveblame call s:BlameFileType()
|
|
||||||
autocmd ColorScheme,GUIEnter * call s:BlameRehighlight()
|
autocmd ColorScheme,GUIEnter * call s:BlameRehighlight()
|
||||||
autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')
|
autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')
|
||||||
augroup END
|
augroup END
|
||||||
|
|||||||
6
ftplugin/fugitiveblame.vim
Normal file
6
ftplugin/fugitiveblame.vim
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
if exists("b:did_ftplugin") || !exists('*fugitive#BlameFileType')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
call fugitive#BlameFileType()
|
||||||
Reference in New Issue
Block a user