mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 15:23:51 -05:00
Decouple autocommand functions from repo object
This commit is contained in:
@@ -160,7 +160,7 @@ augroup fugitive
|
||||
\ if exists('b:NERDTree.root.path.str') |
|
||||
\ call FugitiveDetect(b:NERDTree.root.path.str()) |
|
||||
\ endif
|
||||
autocmd VimEnter * if expand('<amatch>')==''|call FugitiveDetect(getcwd())|endif
|
||||
autocmd VimEnter * if empty(expand('<amatch>'))|call FugitiveDetect(getcwd())|endif
|
||||
autocmd CmdWinEnter * call FugitiveDetect(expand('#:p'))
|
||||
|
||||
autocmd FileType git
|
||||
@@ -172,18 +172,18 @@ augroup fugitive
|
||||
\ call fugitive#MapCfile() |
|
||||
\ endif
|
||||
|
||||
autocmd BufReadCmd index{,.lock}
|
||||
autocmd BufReadCmd index{,.lock}
|
||||
\ if FugitiveIsGitDir(expand('<amatch>:p:h')) |
|
||||
\ let b:git_dir = s:shellslash(expand('<amatch>:p:h')) |
|
||||
\ exe fugitive#BufReadStatus() |
|
||||
\ elseif filereadable(expand('<amatch>')) |
|
||||
\ read <amatch> |
|
||||
\ 1delete |
|
||||
\ 1delete_ |
|
||||
\ endif
|
||||
autocmd BufReadCmd fugitive://*//[0-3]/* exe fugitive#BufReadIndex()
|
||||
autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteIndex()
|
||||
autocmd BufReadCmd fugitive://*//[0-9a-f][0-9a-f]* exe fugitive#BufReadObject()
|
||||
autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd()
|
||||
autocmd SourceCmd fugitive://*//* nested exe fugitive#SourceCmd()
|
||||
autocmd BufReadCmd fugitive://*//* exe fugitive#BufReadCmd()
|
||||
autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteCmd()
|
||||
autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd()
|
||||
autocmd SourceCmd fugitive://*//* nested exe fugitive#SourceCmd()
|
||||
|
||||
autocmd User Flags call Hoist('buffer', function('FugitiveStatusline'))
|
||||
augroup END
|
||||
|
||||
Reference in New Issue
Block a user