Skip to content
Browse files

Add fugitive autocommands and statusline.

  • Loading branch information...
1 parent 12031e9 commit 4603129ff7c7974a1785019f39c8fa0b0ff9997c @nelstrom committed May 14, 2011
Showing with 17 additions and 2 deletions.
  1. +17 −2 vimrc
View
19 vimrc
@@ -1,4 +1,4 @@
-" Folding cheet sheet
+" Folding cheet sheet
" zR open all folds
" zM close all folds
" za toggle fold at cursor position
@@ -321,7 +321,7 @@ function! Stab()
endif
call SummarizeTabs()
endfunction
-
+
function! SummarizeTabs()
try
echohl ModeMsg
@@ -401,6 +401,21 @@ set ww+=<,>
vmap <C-Left> x<Left>P`[v`]
vmap <C-Right> x<Right>P`[v`]
" Configure plugins {{{1
+" Fugitive.vim {{{2
+if has("autocmd")
+
+ " Auto-close fugitive buffers
+ autocmd BufReadPost fugitive://* set bufhidden=delete
+
+ " Navigate up one level from fugitive trees and blobs
+ autocmd User fugitive
+ \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
+ \ nnoremap <buffer> .. :edit %:h<CR> |
+ \ endif
+
+endif
+" Add git branch to statusline.
+set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
" Gundo.vim {{{2
map <Leader>u :GundoToggle<CR>

0 comments on commit 4603129

Please sign in to comment.
Something went wrong with that request. Please try again.