mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
" fugitive.vim - A Git wrapper so awesome, it should be illegal
|
||||
" Maintainer: Tim Pope <http://tpo.pe/>
|
||||
" Version: 3.1
|
||||
" Version: 3.2
|
||||
" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
|
||||
|
||||
if exists('g:loaded_fugitive')
|
||||
@ -66,8 +66,8 @@ function! FugitivePath(...) abort
|
||||
endfunction
|
||||
|
||||
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
|
||||
" containing the Git dir and an object name ("commit:file"). It's effectively
|
||||
" then inverse of FugitiveFind().
|
||||
" containing an object name ("commit:file") and the Git dir. It's effectively
|
||||
" the inverse of FugitiveFind().
|
||||
function! FugitiveParse(...) abort
|
||||
let path = s:Slash(a:0 ? a:1 : @%)
|
||||
if path !~# '^fugitive:'
|
||||
@ -103,6 +103,24 @@ function! FugitiveConfig(...) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Retrieve a Git configuration value. An optional second argument provides
|
||||
" the Git dir as with FugitiveFind(). Pass a blank string to limit to the
|
||||
" global config.
|
||||
function! FugitiveConfigGet(name, ...) abort
|
||||
return call('FugitiveConfig', [a:name] + a:000)
|
||||
endfunction
|
||||
|
||||
" Like FugitiveConfigGet(), but return a list of all values.
|
||||
function! FugitiveConfigGetAll(name, ...) abort
|
||||
if a:0 && type(a:1) ==# type({})
|
||||
let config = a:1
|
||||
else
|
||||
let config = fugitive#Config(FugitiveGitDir(a:0 ? a:1 : -1))
|
||||
endif
|
||||
let name = substitute(a:name, '^[^.]\+\|[^.]\+$', '\L&', 'g')
|
||||
return copy(get(config, name, []))
|
||||
endfunction
|
||||
|
||||
function! FugitiveRemoteUrl(...) abort
|
||||
return fugitive#RemoteUrl(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
||||
endfunction
|
||||
@ -261,9 +279,23 @@ function! FugitiveDetect(path) abort
|
||||
let b:git_dir = dir
|
||||
endif
|
||||
endif
|
||||
if exists('b:git_dir')
|
||||
return fugitive#Init()
|
||||
if !exists('b:git_dir') || !exists('#User#Fugitive')
|
||||
return ''
|
||||
endif
|
||||
if v:version >= 704 || (v:version == 703 && has('patch442'))
|
||||
doautocmd <nomodeline> User Fugitive
|
||||
elseif &modelines > 0
|
||||
let modelines = &modelines
|
||||
try
|
||||
set modelines=0
|
||||
doautocmd User Fugitive
|
||||
finally
|
||||
let &modelines = modelines
|
||||
endtry
|
||||
else
|
||||
doautocmd User Fugitive
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! FugitiveVimPath(path) abort
|
||||
@ -339,6 +371,10 @@ augroup fugitive
|
||||
\ if len(FugitiveGitDir()) |
|
||||
\ call fugitive#MapCfile('fugitive#MessageCfile()') |
|
||||
\ endif
|
||||
autocmd FileType git,gitcommit
|
||||
\ if len(FugitiveGitDir()) && &foldtext ==# 'foldtext()' |
|
||||
\ setlocal foldtext=fugitive#Foldtext() |
|
||||
\ endif
|
||||
autocmd FileType fugitive
|
||||
\ if len(FugitiveGitDir()) |
|
||||
\ call fugitive#MapCfile('fugitive#StatusCfile()') |
|
||||
|
Reference in New Issue
Block a user