Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed colorscheme and added new plugins

  • Loading branch information...
commit a9ba6e1959bf7d31dc6863d3a3bffb6c239d87dc 1 parent d7f45fc
Sebastian authored
View
1  bundle/vim-fugitive/.gitignore
@@ -0,0 +1 @@
+/doc/tags
View
2  bundle/vim-fugitive/README.markdown
@@ -11,7 +11,7 @@ version of the file side by side with the working tree version and use
Vim's diff handling capabilities to stage a subset of the file's
changes.
-Bring up the output of `git status` with `:Gstatus`. Use `-` to
+Bring up the output of `git status` with `:Gstatus`. Press `-` to
`add`/`reset` a file's changes, or `p` to `add`/`reset` `--patch` that
mofo. And guess what `:Gcommit` does!
View
16 bundle/vim-fugitive/doc/fugitive.txt
@@ -1,6 +1,6 @@
*fugitive.txt* A Git wrapper so awesome, it should be illegal
-Author: Tim Pope <vimNOSPAM@tpope.info> *fugitive-author*
+Author: Tim Pope <vimNOSPAM@tpope.org> *fugitive-author*
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
@@ -51,10 +51,13 @@ that are part of Git repositories).
*fugitive-:Gstatus*
:Gstatus Bring up the output of git-status in the preview
- window. Press D to |:Gdiff| the file on the cursor
- line. Press - to stage or unstage the file on the
- cursor line. Press p to do so on a per hunk basis
- (--patch). Press C to invoke |:Gcommit|.
+ window. In addition to standard motions, you can
+ use <C-N> and <C-P> to jump from filename to
+ filename. Press D to |:Gdiff| the file on the cursor
+ line, or dh to |:Gdiff!|. Press - to stage or unstage
+ the file on the cursor line. Press p to do so on a
+ per hunk basis (--patch). Press C to invoke
+ |:Gcommit|.
*fugitive-:Gcommit*
:Gcommit [args] A wrapper around git-commit. If there is nothing
@@ -127,6 +130,9 @@ that are part of Git repositories).
to the right. Use |do| and |dp| and write to the
index file to simulate "git add --patch".
+ *fugitive-:Gdiff!*
+:Gdiff! [revision] Like |:Gdiff|, but split horizontally.
+
*fugitive-:Gmove*
:Gmove {destination} Wrapper around git-mv that renames the buffer
afterward. The destination is relative to the current
View
36 bundle/vim-fugitive/doc/tags
@@ -1,36 +0,0 @@
-fugitive fugitive.txt /*fugitive*
-fugitive#statusline() fugitive.txt /*fugitive#statusline()*
-fugitive-:Gblame fugitive.txt /*fugitive-:Gblame*
-fugitive-:Gcd fugitive.txt /*fugitive-:Gcd*
-fugitive-:Gcommit fugitive.txt /*fugitive-:Gcommit*
-fugitive-:Gdiff fugitive.txt /*fugitive-:Gdiff*
-fugitive-:Ge fugitive.txt /*fugitive-:Ge*
-fugitive-:Gedit fugitive.txt /*fugitive-:Gedit*
-fugitive-:Ggrep fugitive.txt /*fugitive-:Ggrep*
-fugitive-:Git fugitive.txt /*fugitive-:Git*
-fugitive-:Glcd fugitive.txt /*fugitive-:Glcd*
-fugitive-:Glog fugitive.txt /*fugitive-:Glog*
-fugitive-:Gmove fugitive.txt /*fugitive-:Gmove*
-fugitive-:Gpedit fugitive.txt /*fugitive-:Gpedit*
-fugitive-:Gread fugitive.txt /*fugitive-:Gread*
-fugitive-:Gread! fugitive.txt /*fugitive-:Gread!*
-fugitive-:Gremove fugitive.txt /*fugitive-:Gremove*
-fugitive-:Gsplit fugitive.txt /*fugitive-:Gsplit*
-fugitive-:Gstatus fugitive.txt /*fugitive-:Gstatus*
-fugitive-:Gtabedit fugitive.txt /*fugitive-:Gtabedit*
-fugitive-:Gvsplit fugitive.txt /*fugitive-:Gvsplit*
-fugitive-:Gwrite fugitive.txt /*fugitive-:Gwrite*
-fugitive-<CR> fugitive.txt /*fugitive-<CR>*
-fugitive-C fugitive.txt /*fugitive-C*
-fugitive-O fugitive.txt /*fugitive-O*
-fugitive-P fugitive.txt /*fugitive-P*
-fugitive-a fugitive.txt /*fugitive-a*
-fugitive-about fugitive.txt /*fugitive-about*
-fugitive-author fugitive.txt /*fugitive-author*
-fugitive-commands fugitive.txt /*fugitive-commands*
-fugitive-mappings fugitive.txt /*fugitive-mappings*
-fugitive-o fugitive.txt /*fugitive-o*
-fugitive-revision fugitive.txt /*fugitive-revision*
-fugitive-statusline fugitive.txt /*fugitive-statusline*
-fugitive-~ fugitive.txt /*fugitive-~*
-fugitive.txt fugitive.txt /*fugitive.txt*
View
219 bundle/vim-fugitive/plugin/fugitive.vim
@@ -132,19 +132,22 @@ function! s:Detect(path)
if exists('b:git_dir')
silent doautocmd User Fugitive
cnoremap <expr> <buffer> <C-R><C-G> fugitive#buffer().rev()
+ let buffer = fugitive#buffer()
if expand('%:p') =~# '//'
- let buffer = fugitive#buffer()
call buffer.setvar('&path',s:sub(buffer.getvar('&path'),'^\.%(,|$)',''))
endif
+ if b:git_dir !~# ',' && stridx(buffer.getvar('&tags'),b:git_dir.'/tags') == -1
+ call buffer.setvar('&tags',buffer.getvar('&tags').','.b:git_dir.'/tags')
+ endif
endif
endfunction
augroup fugitive
autocmd!
autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p'))
- autocmd FileType netrw call s:Detect(expand('<amatch>:p'))
+ autocmd FileType netrw call s:Detect(expand('<afile>:p'))
autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif
- autocmd BufWinLeave * execute getbufvar(+expand('<abuf>'), 'fugitive_restore')
+ autocmd BufWinLeave * execute getwinvar(+winnr(), 'fugitive_restore')
augroup END
" }}}1
@@ -351,7 +354,7 @@ endfunction
function! s:buffer_type(...) dict abort
if self.getvar('fugitive_type') != ''
let type = self.getvar('fugitive_type')
- elseif fnamemodify(self.name(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$'
+ elseif fnamemodify(self.spec(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$'
let type = 'head'
elseif self.getline(1) =~ '^tree \x\{40\}$' && self.getline(2) == ''
let type = 'tree'
@@ -359,11 +362,11 @@ function! s:buffer_type(...) dict abort
let type = 'tree'
elseif self.getline(1) =~ '^\d\{6\} \x\{40\}\> \d\t'
let type = 'index'
- elseif isdirectory(self.name())
+ elseif isdirectory(self.spec())
let type = 'directory'
- elseif self.name() == ''
+ elseif self.spec() == ''
let type = 'null'
- elseif filereadable(self.name())
+ elseif filereadable(self.spec())
let type = 'file'
else
let type = ''
@@ -375,42 +378,61 @@ function! s:buffer_type(...) dict abort
endif
endfunction
+if has('win32')
+
+ function! s:buffer_spec() dict abort
+ let bufname = bufname(self['#'])
+ let retval = ''
+ for i in split(bufname,'[^:]\zs\\')
+ let retval = fnamemodify((retval==''?'':retval.'\').i,':.')
+ endfor
+ return s:shellslash(fnamemodify(retval,':p'))
+ endfunction
+
+else
+
+ function! s:buffer_spec() dict abort
+ let bufname = bufname(self['#'])
+ return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p'))
+ endfunction
+
+endif
+
function! s:buffer_name() dict abort
- let bufname = bufname(self['#'])
- return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p'))
+ return self.spec()
endfunction
function! s:buffer_commit() dict abort
- return matchstr(self.name(),'^fugitive://.\{-\}//\zs\w*')
+ return matchstr(self.spec(),'^fugitive://.\{-\}//\zs\w*')
endfunction
function! s:buffer_path(...) dict abort
- let rev = matchstr(self.name(),'^fugitive://.\{-\}//\zs.*')
+ let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
if rev != ''
let rev = s:sub(rev,'\w*','')
else
- let rev = self.name()[strlen(self.repo().tree()) : -1]
+ let rev = self.spec()[strlen(self.repo().tree()) : -1]
endif
- return s:sub(rev,'^/',a:0 ? a:1 : '')
+ return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '')
endfunction
function! s:buffer_rev() dict abort
- let rev = matchstr(self.name(),'^fugitive://.\{-\}//\zs.*')
+ let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
if rev =~ '^\x/'
return ':'.rev[0].':'.rev[2:-1]
elseif rev =~ '.'
return s:sub(rev,'/',':')
- elseif self.name() =~ '\.git/index$'
+ elseif self.spec() =~ '\.git/index$'
return ':'
- elseif self.name() =~ '\.git/refs/\|\.git/.*HEAD$'
- return self.name()[strlen(self.repo().dir())+1 : -1]
+ elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
+ return self.spec()[strlen(self.repo().dir())+1 : -1]
else
return self.path()
endif
endfunction
function! s:buffer_sha1() dict abort
- if self.name() =~ '^fugitive://' || self.name() =~ '\.git/refs/\|\.git/.*HEAD$'
+ if self.spec() =~ '^fugitive://' || self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
return self.repo().rev_parse(self.rev())
else
return ''
@@ -430,7 +452,7 @@ function! s:buffer_expand(rev) dict abort
else
let file = a:rev
endif
- return s:sub(file,'\%$',self.path())
+ return s:sub(s:sub(file,'\%$',self.path()),'/$','')
endfunction
function! s:buffer_containing_commit() dict abort
@@ -443,7 +465,7 @@ function! s:buffer_containing_commit() dict abort
endif
endfunction
-call s:add_methods('buffer',['getvar','setvar','getline','repo','type','name','commit','path','rev','sha1','expand','containing_commit'])
+call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','path','rev','sha1','expand','containing_commit'])
" }}}1
" Git {{{1
@@ -538,10 +560,10 @@ function! fugitive#reload_status() abort
endfor
endfunction
-function! s:StageDiff() abort
+function! s:StageDiff(bang) abort
let section = getline(search('^# .*:$','bnW'))
let line = getline('.')
- let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*')
+ let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
if filename ==# '' && section == '# Changes to be committed:'
return 'Git diff --cached'
elseif filename ==# ''
@@ -549,13 +571,13 @@ function! s:StageDiff() abort
elseif line =~# '^#\trenamed:' && filename =~ ' -> '
let [old, new] = split(filename,' -> ')
execute 'Gedit '.s:fnameescape(':0:'.new)
- return 'Gdiff HEAD:'.s:fnameescape(old)
+ return 'Gdiff'.a:bang.' HEAD:'.s:fnameescape(old)
elseif section == '# Changes to be committed:'
execute 'Gedit '.s:fnameescape(':0:'.filename)
- return 'Gdiff -'
+ return 'Gdiff'.a:bang.' -'
else
execute 'Gedit '.s:fnameescape('/'.filename)
- return 'Gdiff'
+ return 'Gdiff'.a:bang
endif
endfunction
@@ -567,7 +589,7 @@ function! s:StageToggle(lnum1,lnum2) abort
if getline('.') == '# Changes to be committed:'
return 'Gcommit'
endif
- let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*')
+ let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
if filename ==# ''
continue
endif
@@ -597,7 +619,7 @@ function! s:StageToggle(lnum1,lnum2) abort
silent! edit!
1
redraw
- call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.jump.'\$','W')
+ call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.jump.'\%( (new commits)\)\=\$','W')
endif
echo s:sub(s:gsub(output,'\n+','\n'),'\n$','')
catch /^fugitive:/
@@ -617,7 +639,7 @@ function! s:StagePatch(lnum1,lnum2) abort
elseif line == '# Changed but not updated:'
return 'Git add --patch'
endif
- let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*')
+ let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$')
if filename ==# ''
continue
endif
@@ -645,7 +667,7 @@ function! s:StagePatch(lnum1,lnum2) abort
silent! edit!
1
redraw
- call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.first_filename.'\$','W')
+ call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.first_filename.'\%( (new commits)\)\=\$','W')
endif
catch /^fugitive:/
return 'echoerr v:errmsg'
@@ -690,7 +712,8 @@ function! s:Commit(args) abort
endif
return ''
else
- let error = get(readfile(errorfile,'',1),0,'!')
+ let errors = readfile(errorfile)
+ let error = get(errors,-2,get(errors,-1,'!'))
if error =~# "'false'\\.$"
let args = a:args
let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-[se]|--edit|--interactive)%($| )','')
@@ -741,7 +764,6 @@ endfunction
function! s:FinishCommit()
let args = getbufvar(+expand('<abuf>'),'fugitive_commit_arguments')
- let g:args = args
if !empty(args)
call setbufvar(+expand('<abuf>'),'fugitive_commit_arguments','')
return s:Commit(args)
@@ -853,7 +875,7 @@ function! s:Edit(cmd,...) abort
if a:cmd =~# '!$'
call s:warn(':Gread! is deprecated. Use :Gread')
endif
- return 'silent %delete|read '.s:fnameescape(file).'|silent 1delete_|diffupdate|'.line('.')
+ return 'silent %delete_|read '.s:fnameescape(file).'|silent 1delete_|diffupdate|'.line('.')
else
if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
wincmd p
@@ -941,7 +963,11 @@ function! s:Write(force,...) abort
execute 'write! '.s:fnameescape(s:repo().translate(path))
endif
- let error = s:repo().git_chomp_in_tree('add', file)
+ if a:force
+ let error = s:repo().git_chomp_in_tree('add', '--force', file)
+ else
+ let error = s:repo().git_chomp_in_tree('add', file)
+ endif
if v:shell_error
let v:errmsg = 'fugitive: '.error
return 'echoerr v:errmsg'
@@ -996,13 +1022,41 @@ endfunction
" }}}1
" Gdiff {{{1
-call s:command("-bar -nargs=? -complete=customlist,s:EditComplete Gdiff :execute s:Diff(<f-args>)")
+call s:command("-bang -bar -nargs=? -complete=customlist,s:EditComplete Gdiff :execute s:Diff(<bang>0,<f-args>)")
+call s:command("-bar -nargs=? -complete=customlist,s:EditComplete Gvdiff :execute s:Diff(0,<f-args>)")
+call s:command("-bar -nargs=? -complete=customlist,s:EditComplete Gsdiff :execute s:Diff(1,<f-args>)")
augroup fugitive_diff
- autocmd BufWinLeave * if winnr('$') == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff! | endif
- autocmd BufWinEnter * if winnr('$') == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff | endif
+ autocmd!
+ autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | call s:diff_off_all(getbufvar(+expand('<abuf>'), 'git_dir')) | endif
+ autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff | endif
augroup END
+function! s:diff_window_count()
+ let c = 0
+ for nr in range(1,winnr('$'))
+ let c += getwinvar(nr,'&diff')
+ endfor
+ return c
+endfunction
+
+function! s:diff_off_all(dir)
+ for nr in range(1,winnr('$'))
+ if getwinvar(nr,'&diff')
+ if nr != winnr()
+ execute nr.'wincmd w'
+ let restorewinnr = 1
+ endif
+ if exists('b:git_dir') && b:git_dir ==# a:dir
+ diffoff
+ endif
+ if exists('restorewinnr')
+ wincmd p
+ endif
+ endif
+ endfor
+endfunction
+
function! s:buffer_compare_age(commit) dict abort
let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5}
let my_score = get(scores,':'.self.commit(),0)
@@ -1025,18 +1079,19 @@ endfunction
call s:add_methods('buffer',['compare_age'])
-function! s:Diff(...) abort
+function! s:Diff(bang,...) abort
+ let split = a:bang ? 'split' : 'vsplit'
if exists(':DiffGitCached')
return 'DiffGitCached'
elseif (!a:0 || a:1 == ':') && s:buffer().commit() =~# '^[0-1]\=$' && s:repo().git_chomp_in_tree('ls-files', '--unmerged', '--', s:buffer().path()) !=# ''
- leftabove vsplit `=fugitive#buffer().repo().translate(s:buffer().expand(':2'))`
- diffthis
- wincmd p
- rightbelow vsplit `=fugitive#buffer().repo().translate(s:buffer().expand(':3'))`
- diffthis
- wincmd p
- diffthis
- return ''
+ execute 'leftabove '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
+ diffthis
+ wincmd p
+ execute 'rightbelow '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
+ diffthis
+ wincmd p
+ diffthis
+ return ''
elseif a:0
if a:1 ==# ''
return ''
@@ -1063,9 +1118,9 @@ function! s:Diff(...) abort
let spec = s:repo().translate(file)
let commit = matchstr(spec,'\C[^:/]//\zs\x\+')
if s:buffer().compare_age(commit) < 0
- rightbelow vsplit `=spec`
+ execute 'rightbelow '.split.' `=spec`'
else
- leftabove vsplit `=spec`
+ execute 'leftabove '.split.' `=spec`'
endif
diffthis
wincmd p
@@ -1088,6 +1143,11 @@ function! s:Move(force,destination)
let destination = destination[strlen(s:repo().tree('')):-1]
endif
endif
+ if isdirectory(s:buffer().name())
+ " Work around Vim parser idiosyncrasy
+ let b = s:buffer()
+ call b.setvar('&swapfile',0)
+ endif
let message = call(s:repo().git_chomp_in_tree,['mv']+(a:force ? ['-f'] : [])+['--', s:buffer().path(), destination], s:repo())
if v:shell_error
let v:errmsg = 'fugitive: '.message
@@ -1099,7 +1159,11 @@ function! s:Move(force,destination)
endif
call fugitive#reload_status()
if s:buffer().commit() == ''
- return 'saveas! '.s:fnameescape(destination)
+ if isdirectory(destination)
+ return 'edit '.s:fnameescape(destination)
+ else
+ return 'saveas! '.s:fnameescape(destination)
+ endif
else
return 'file '.s:fnameescape(s:repo().translate(':0:'.destination)
endif
@@ -1184,17 +1248,25 @@ function! s:Blame(bang,line1,line2,count,args) abort
else
let error = tempname()
let temp = error.'.fugitiveblame'
- silent! exe '%write !'.basecmd.' > '.temp.' 2> '.error
+ if &shell =~# 'csh'
+ silent! execute '%write !('.basecmd.' > '.temp.') >& '.error
+ else
+ silent! execute '%write !'.basecmd.' > '.temp.' 2> '.error
+ endif
+ if exists('l:dir')
+ execute cd.'`=dir`'
+ unlet dir
+ endif
if v:shell_error
call s:throw(join(readfile(error),"\n"))
endif
let bufnr = bufnr('')
- let restore = 'call setbufvar('.bufnr.',"&scrollbind",0)'
+ let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
if &l:wrap
- let restore .= '|call setbufvar('.bufnr.',"&wrap",1)'
+ let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)'
endif
if &l:foldenable
- let restore .= '|call setbufvar('.bufnr.',"&foldenable",1)'
+ let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
endif
let winnr = winnr()
windo set noscrollbind
@@ -1206,7 +1278,7 @@ function! s:Blame(bang,line1,line2,count,args) abort
let b:git_dir = git_dir
let b:fugitive_type = 'blame'
let b:fugitive_blamed_bufnr = bufnr
- let b:fugitive_restore = restore
+ let w:fugitive_restore = restore
let b:fugitive_blame_arguments = join(a:args,' ')
call s:Detect(expand('%:p'))
execute top
@@ -1338,7 +1410,7 @@ function! s:BufReadIndex()
if fnamemodify($GIT_INDEX_FILE !=# '' ? $GIT_INDEX_FILE : b:git_dir . '/index', ':p') ==# expand('%:p')
let index = ''
else
- let index = expand('%')
+ let index = expand('%:p')
endif
if b:fugitive_display_format
call s:ReplaceCmd(s:repo().git_command('ls-files','--stage'),index)
@@ -1357,11 +1429,15 @@ function! s:BufReadIndex()
setlocal ro noma nomod nomodeline bufhidden=delete
nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR>
nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= 1<Bar>exe <SID>BufReadIndex()<CR>
- nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff()<CR>
+ nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff('')<CR>
+ nnoremap <buffer> <silent> dd :<C-U>execute <SID>StageDiff('')<CR>
+ nnoremap <buffer> <silent> dh :<C-U>execute <SID>StageDiff('!')<CR>
nnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line('.'),line('.')+v:count1-1)<CR>
xnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line("'<"),line("'>"))<CR>
nnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>
xnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
+ nnoremap <buffer> <silent> <C-N> :call search('^#\t.*','W')<Bar>.<CR>
+ nnoremap <buffer> <silent> <C-P> :call search('^#\t.*','Wbe')<Bar>.<CR>
call s:JumpInit()
nunmap <buffer> P
nunmap <buffer> ~
@@ -1415,7 +1491,11 @@ function! s:BufWriteIndexFile()
endif
let info = old_mode.' '.sha1.' '.stage."\t".path
call writefile([info],tmp)
- let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)
+ if has('win32')
+ let error = system('type '.tmp.'|'.s:repo().git_command('update-index','--index-info'))
+ else
+ let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)
+ endif
if v:shell_error == 0
setlocal nomodified
silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))
@@ -1539,9 +1619,9 @@ function! s:GF(mode) abort
if showtree && line('.') == 1
return ""
elseif showtree && line('.') > 2
- return s:Edit(a:mode,buffer.commit().':'.(buffer.path() == '' ? '' : buffer.path().'/').s:sub(getline('.'),'/$',''))
+ return s:Edit(a:mode,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(getline('.'),'/$',''))
elseif getline('.') =~# '^\d\{6\} \l\{3,8\} \x\{40\}\t'
- return s:Edit(a:mode,buffer.commit().':'.(buffer.path() == '' ? '' : buffer.path().'/').s:sub(matchstr(getline('.'),'\t\zs.*'),'/$',''))
+ return s:Edit(a:mode,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(matchstr(getline('.'),'\t\zs.*'),'/$',''))
endif
elseif buffer.type('blob')
@@ -1566,7 +1646,7 @@ function! s:GF(mode) abort
let file = '/'.matchstr(getline('.'),' -> \zs.*')
return s:Edit(a:mode,file)
elseif getline('.') =~# '^#\t[[:alpha:] ]\+: *.'
- let file = '/'.matchstr(getline('.'),': *\zs.*')
+ let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( (new commits)\)\=$')
return s:Edit(a:mode,file)
elseif getline('.') =~# '^#\t.'
let file = '/'.matchstr(getline('.'),'#\t\zs.*')
@@ -1629,6 +1709,13 @@ function! s:GF(mode) abort
elseif getline('.') =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
let dref = matchstr(getline('.'),'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
let ref = matchstr(getline('.'),'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+ let dcmd = 'Gdiff'
+
+ elseif getline('.') =~# '^index ' && getline(line('.')-1) =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
+ let line = getline(line('.')-1)
+ let dref = matchstr(line,'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+ let ref = matchstr(line,'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+ let dcmd = 'Gdiff!'
elseif line('$') == 1 && getline('.') =~ '^\x\{40\}$'
let ref = getline('.')
@@ -1656,7 +1743,7 @@ function! s:GF(mode) abort
endif
if exists('dref')
- return s:Edit(a:mode,ref) . '|Gdiff '.s:fnameescape(dref)
+ return s:Edit(a:mode,ref) . '|'.dcmd.' '.s:fnameescape(dref)
elseif ref != ""
return s:Edit(a:mode,ref)
endif
@@ -1698,6 +1785,18 @@ function! fugitive#statusline(...)
endif
endfunction
+function! s:repo_config(conf) dict abort
+ return matchstr(system(s:repo().git_command('config').' '.a:conf),"[^\r\n]*")
+endfun
+
+function! s:repo_user() dict abort
+ let username = s:repo().config('user.name')
+ let useremail = s:repo().config('user.email')
+ return username.' <'.useremail.'>'
+endfun
+
+call s:add_methods('repo',['config', 'user'])
+
" }}}1
" vim:set ft=vim ts=8 sw=2 sts=2:
View
1  bundle/vim-git/doc/tags
@@ -1 +0,0 @@
-ft-gitcommit-plugin ft-gitcommit-plugin.txt /*ft-gitcommit-plugin*
View
2  bundle/vim-git/indent/gitconfig.vim
@@ -11,6 +11,8 @@ setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
+let b:undo_indent = 'setl ai< inde< indk<'
+
" Only define the function once.
if exists("*GetGitconfigIndent")
finish
View
212 colors/ir_black.vim
@@ -0,0 +1,212 @@
+" ir_black color scheme
+" More at: http://blog.infinitered.com/entries/show/8
+
+
+" ********************************************************************************
+" Standard colors used in all ir_black themes:
+" Note, x:x:x are RGB values
+"
+" normal: #f6f3e8
+"
+" string: #A8FF60 168:255:96
+" string inner (punc, code, etc): #00A0A0 0:160:160
+" number: #FF73FD 255:115:253
+" comments: #7C7C7C 124:124:124
+" keywords: #96CBFE 150:203:254
+" operators: white
+" class: #FFFFB6 255:255:182
+" method declaration name: #FFD2A7 255:210:167
+" regular expression: #E9C062 233:192:98
+" regexp alternate: #FF8000 255:128:0
+" regexp alternate 2: #B18A3D 177:138:61
+" variable: #C6C5FE 198:197:254
+"
+" Misc colors:
+" red color (used for whatever): #FF6C60 255:108:96
+" light red: #FFB6B0 255:182:176
+"
+" brown: #E18964 good for special
+"
+" lightpurpleish: #FFCCFF
+"
+" Interface colors:
+" background color: black
+" cursor (where underscore is used): #FFA560 255:165:96
+" cursor (where block is used): white
+" visual selection: #1D1E2C
+" current line: #151515 21:21:21
+" search selection: #07281C 7:40:28
+" line number: #3D3D3D 61:61:61
+
+
+" ********************************************************************************
+" The following are the preferred 16 colors for your terminal
+" Colors Bright Colors
+" Black #4E4E4E #7C7C7C
+" Red #FF6C60 #FFB6B0
+" Green #A8FF60 #CEFFAB
+" Yellow #FFFFB6 #FFFFCB
+" Blue #96CBFE #FFFFCB
+" Magenta #FF73FD #FF9CFE
+" Cyan #C6C5FE #DFDFFE
+" White #EEEEEE #FFFFFF
+
+
+" ********************************************************************************
+set background=dark
+hi clear
+
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "ir_black"
+
+
+"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+
+" General colors
+hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE
+
+hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse
+hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
+
+hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE
+hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=white ctermbg=darkgray cterm=NONE
+hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE
+
+hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE
+hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE
+
+hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+
+hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE
+hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE
+"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+
+hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color
+hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
+hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
+
+" Message displayed in lower left, such as --INSERT--
+hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD
+
+if version >= 700 " Vim 7.x specific colors
+ hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
+ hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
+ hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE
+ hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+ hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
+ hi Search guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline
+endif
+
+" Syntax highlighting
+hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
+hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE
+hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE
+
+hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
+hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
+hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end
+
+hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE
+hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
+
+hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
+hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
+hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE
+hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE
+
+hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
+hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
+hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
+
+hi link Character Constant
+hi link Boolean Constant
+hi link Float Number
+hi link Repeat Statement
+hi link Label Statement
+hi link Exception Statement
+hi link Include PreProc
+hi link Define PreProc
+hi link Macro PreProc
+hi link PreCondit PreProc
+hi link StorageClass Type
+hi link Structure Type
+hi link Typedef Type
+hi link Tag Special
+hi link SpecialChar Special
+hi link SpecialComment Special
+hi link Debug Special
+
+
+" Special for Ruby
+hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
+hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
+hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
+hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
+hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc
+"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield
+hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE
+"rubyInclude
+"rubySharpBang
+"rubyAccess
+"rubyPredefinedVariable
+"rubyBoolean
+"rubyClassVariable
+"rubyBeginEnd
+"rubyRepeatModifier
+"hi link rubyArrayDelimiter Special " [ , , ]
+"rubyCurlyBlock { , , }
+
+hi link rubyClass Keyword
+hi link rubyModule Keyword
+hi link rubyKeyword Keyword
+hi link rubyOperator Operator
+hi link rubyIdentifier Identifier
+hi link rubyInstanceVariable Identifier
+hi link rubyGlobalVariable Identifier
+hi link rubyClassVariable Identifier
+hi link rubyConstant Type
+
+
+" Special for Java
+" hi link javaClassDecl Type
+hi link javaScopeDecl Identifier
+hi link javaCommentTitle javaDocSeeTag
+hi link javaDocTags javaDocSeeTag
+hi link javaDocParam javaDocSeeTag
+hi link javaDocSeeTagParam javaDocSeeTag
+
+hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
+hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
+"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
+
+
+" Special for XML
+hi link xmlTag Keyword
+hi link xmlTagName Conditional
+hi link xmlEndTag Identifier
+
+
+" Special for HTML
+hi link htmlTag Keyword
+hi link htmlTagName Conditional
+hi link htmlEndTag Identifier
+
+
+" Special for Javascript
+hi link javaScriptNumber Number
+
+
+" Special for Python
+"hi link pythonEscape Keyword
+
+
+" Special for CSharp
+hi link csXmlTag Keyword
+
+
+" Special for PHP
View
7 gvimrc
@@ -1,13 +1,14 @@
" Example Vim graphical configuration.
" Copy to ~/.gvimrc or ~/_gvimrc.
-set guifont=Inconsolata:h20 " Font family and font size.
+set guifont=Inconsolata:h30 " Font family and font size.
set antialias " MacVim: smooth fonts.
set encoding=utf-8 " Use UTF-8 everywhere.
+
set guioptions-=T " Hide toolbar.
set background=light " Background.
-set lines=25 columns=100 " Window dimensions.
+set lines=60 columns=100 " Window dimensions.
set guioptions-=r " Don't show right scrollbar
-
+colorscheme eclm_wombat
View
26 vimrc
@@ -53,9 +53,6 @@ set laststatus=2 " Show the status line all the time
" Useful status information at bottom of screen
set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
-" Or use vividchalk
-"# colorscheme default
-
" Tab mappings.
map <leader>tt :tabnew<cr>
map <leader>te :tabedit
@@ -67,19 +64,9 @@ map <leader>tf :tabfirst<cr>
map <leader>tl :tablast<cr>
map <leader>tm :tabmove
-" Uncomment to use Jamis Buck's file opening plugin
-"map <Leader>t :FuzzyFinderTextMate<Enter>
-
-" Controversial...swap colon and semicolon for easier commands
-"nnoremap ; :
-"nnoremap : ;
-
-"vnoremap ; :
-"vnoremap : ;
-
" Automatic fold settings for specific files. Uncomment to use.
-" autocmd FileType ruby setlocal foldmethod=syntax
-" autocmd FileType css setlocal foldmethod=indent shiftwidth=2 tabstop=2
+autocmd FileType ruby setlocal foldmethod=syntax
+autocmd FileType css setlocal foldmethod=indent shiftwidth=2 tabstop=2
" For the MakeGreen plugin and Ruby RSpec. Uncomment to use.
autocmd BufNewFile,BufRead *_spec.rb compiler rspec
@@ -140,10 +127,6 @@ inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
-inoremap <F1> <ESC>
-nnoremap <F1> <ESC>
-vnoremap <F1> <ESC>
-
" Save on lost focus
au FocusLost * :wa
@@ -176,7 +159,6 @@ if !exists("autocommands_loaded")
endif
imap jj <Esc>
-imap kk <Esc>
" Toggling between showing an hiding invisible characters
nmap <leader>l :set list!<CR>
@@ -198,4 +180,6 @@ set spelllang=en_gb
" set guifont="Menlo\ 13"
" My own little refactoring mapping for inlining a varialbe
-nnoremap <leader>inl ^*``f=wdt,``hpldw``dd
+nnoremap <leader>inl ^mq*``f=wv$hh"wy``dw"wPV=`qdd
+
+colorscheme eclm_wombat
Please sign in to comment.
Something went wrong with that request. Please try again.