aboutsummaryrefslogtreecommitdiff
path: root/base/vim/plugin/gitbranch.vim
diff options
context:
space:
mode:
Diffstat (limited to 'base/vim/plugin/gitbranch.vim')
-rw-r--r--base/vim/plugin/gitbranch.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/base/vim/plugin/gitbranch.vim b/base/vim/plugin/gitbranch.vim
new file mode 100644
index 0000000..a6f776a
--- /dev/null
+++ b/base/vim/plugin/gitbranch.vim
@@ -0,0 +1,23 @@
+" =============================================================================
+" Filename: plugin/gitbranch.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2015/05/12 08:16:47.
+" =============================================================================
+
+if exists('g:loaded_gitbranch') || v:version < 700
+ finish
+endif
+let g:loaded_gitbranch = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+augroup GitBranch
+ autocmd!
+ autocmd BufNewFile,BufReadPost * call gitbranch#detect(expand('<amatch>:p:h'))
+ autocmd BufEnter * call gitbranch#detect(expand('%:p:h'))
+augroup END
+
+let &cpo = s:save_cpo
+unlet s:save_cpo