1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins. Added vim-golang as a mode

This commit is contained in:
amix
2014-03-11 21:10:50 +01:00
parent 2b82c75631
commit 8f0740e307
125 changed files with 4121 additions and 2440 deletions

View File

@ -3,13 +3,13 @@ and removing other plugins. The sad truth about VimScript is that it is
fraught with incompatibilities waiting to happen. I'm happy to work around
them where I can, but it's up to you to isolate the conflict.
If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
I'm not going to accept your pull request. I've explained very politely
dozens of times that
[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
are absolute rules on my own repositories, so I may lack the energy to explain
it to you yet another time. And please, if I ask you to change something,
`git commit --amend`.
Fugitive is particularly prone to regressions due to Git version issues,
platform issues, and interactions with other plugins. I end up bisecting a
lot more than other projects, and thus I'm especially meticulous here about
maintaining a clean, readable, history. Squash and force push any requested
changes to a pull request. And if your [commit message
sucks](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
I'm not going to accept it. Period.
Beyond that, don't be shy about asking before patching. What takes you hours
might take me minutes simply because I have both domain knowledge and a

View File

@ -139,6 +139,9 @@ function! fugitive#extract_git_dir(path) abort
if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0
break
endif
if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR)
return $GIT_DIR
endif
let dir = s:sub(root, '[\/]$', '') . '/.git'
let type = getftype(dir)
if type ==# 'dir' && fugitive#is_git_dir(dir)
@ -736,14 +739,16 @@ function! s:stage_info(lnum) abort
endwhile
if !lnum
return ['', '']
elseif getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' || getline(lnum) ==# '# Changes to be committed:'
elseif (getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Changes to be committed:'
return [matchstr(filename, colon.' *\zs.*'), 'staged']
elseif (getline(lnum+1) =~# '^# .*\<git add ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Untracked files:'
return [filename, 'untracked']
elseif getline(lnum+2) =~# '^# .*\<git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
return [matchstr(filename, colon.' *\zs.*'), 'unstaged']
elseif getline(lnum+1) =~# '^# .*\<git add/rm ' || getline(lnum) ==# '# Unmerged paths:'
elseif getline(lnum+2) =~# '^# .*\<git \%(add\|rm\)' || getline(lnum) ==# '# Unmerged paths:'
return [matchstr(filename, colon.' *\zs.*'), 'unmerged']
else
return [filename, 'untracked']
return ['', 'unknown']
endif
endfunction
@ -1142,7 +1147,8 @@ function! s:Edit(cmd,bang,...) abort
endif
if a:bang
let args = s:gsub(join(a:000, ' '), '\\@<!%(\\\\)*\zs[%#]', '\=s:buffer().expand(submatch(0))')
let arglist = map(copy(a:000), 's:gsub(v:val, ''\\@<!%(\\\\)*\zs[%#]'', ''\=s:buffer().expand(submatch(0))'')')
let args = join(arglist, ' ')
if a:cmd =~# 'read'
let git = buffer.repo().git_command()
let last = line('$')
@ -1155,7 +1161,7 @@ function! s:Edit(cmd,bang,...) abort
return 'redraw|echo '.string(':!'.git.' '.args)
else
let temp = resolve(tempname())
let s:temp_files[temp] = buffer.repo().dir()
let s:temp_files[temp] = { 'dir': buffer.repo().dir(), 'args': arglist }
silent execute a:cmd.' '.temp
if a:cmd =~# 'pedit'
wincmd P
@ -1630,7 +1636,8 @@ function! s:Blame(bang,line1,line2,count,args) abort
else
let cmd += ['--contents', '-']
endif
let basecmd = escape(call(s:repo().git_command,cmd+['--',s:buffer().path()],s:repo()),'!')
let cmd += ['--', s:buffer().path()]
let basecmd = escape(call(s:repo().git_command,cmd,s:repo()),'!')
try
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
if !s:repo().bare()
@ -1671,7 +1678,7 @@ function! s:Blame(bang,line1,line2,count,args) abort
setlocal scrollbind nowrap nofoldenable
let top = line('w0') + &scrolloff
let current = line('.')
let s:temp_files[temp] = s:repo().dir()
let s:temp_files[temp] = { 'dir': s:repo().dir(), 'args': cmd }
exe 'keepalt leftabove vsplit '.temp
let b:fugitive_blamed_bufnr = bufnr
let w:fugitive_leave = restore
@ -2309,8 +2316,9 @@ augroup fugitive_temp
autocmd!
autocmd BufNewFile,BufReadPost *
\ if has_key(s:temp_files,expand('<afile>:p')) |
\ let b:git_dir = s:temp_files[expand('<afile>:p')] |
\ let b:git_dir = s:temp_files[expand('<afile>:p')].dir |
\ let b:git_type = 'temp' |
\ let b:git_args = s:temp_files[expand('<afile>:p')].args |
\ call fugitive#detect(expand('<afile>:p')) |
\ setlocal bufhidden=delete |
\ nnoremap <buffer> <silent> q :<C-U>bdelete<CR>|