Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #24 from tksohishi/master

Add preset width support and keymap for GitBlame
  • Loading branch information...
commit 9042e0d3556c2b406086f294ee1e97e1a0bc38c1 2 parents 74d01ae + 2a57d9a
@motemen authored
Showing with 6 additions and 4 deletions.
  1. +2 −0  README.rdoc
  2. +4 −4 plugin/git.vim
View
2  README.rdoc
@@ -16,6 +16,7 @@ Git-vim provides:
[:GitPullRebase] git-pull --rebase.
[:GitPush <args>] git-push. Defaults to +git push origin <current-branch>+.
[:GitCatFile <args>] git-cat-file.
+[:GitBlame <args>] git-blame.
[:Git <args>] Does any git command.
[:GitVimDiffMerge] Experimental. Call this command on unmerged file to enter vimdiff mode.
[:GitVimDiffMergeDone] Call this command after merging.
@@ -28,6 +29,7 @@ Git-vim provides:
[<Leader>ga] :GitAdd
[<Leader>gA] :GitAdd <cfile>
[<Leader>gc] :GitCommit
+[<Leader>gb] :GitBlame
=== In git-status buffer
[<Enter>] :GitAdd <cfile>
View
8 plugin/git.vim
@@ -31,6 +31,7 @@ if !exists('g:git_no_map_default') || !g:git_no_map_default
nnoremap <Leader>gA :GitAdd <cfile><Enter>
nnoremap <Leader>gc :GitCommit<Enter>
nnoremap <Leader>gp :GitPullRebase<Enter>
+ nnoremap <Leader>gb :GitBlame<Enter>
endif
" Ensure b:git_dir exists.
@@ -197,15 +198,17 @@ endfunction
" Show revision and author for each line.
function! GitBlame(...)
- let l:git_blame_width = 20
let git_output = s:SystemGit('blame -- ' . expand('%'))
if !strlen(git_output)
echo "No output from git command"
return
endif
+ let l:git_blame_width = 20
if strlen(a:1)
let l:git_blame_width = a:1
+ elseif exists('g:git_blame_width') && g:git_blame_width
+ let l:git_blame_width = g:git_blame_width
endif
setlocal noscrollbind
@@ -232,9 +235,6 @@ function! GitBlame(...)
syncbind
endfunction
-
-
-
" Experimental
function! s:DoHighlightGitBlame()
for l in range(1, line('$'))
Please sign in to comment.
Something went wrong with that request. Please try again.