From 87c73b77964b582900c50308eddd9518948eb895 Mon Sep 17 00:00:00 2001 From: Adam Hovorka Date: Sun, 7 Oct 2018 09:54:18 -0600 Subject: Customize vim statusline --- base/vim/plugin/gitbranch.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 base/vim/plugin/gitbranch.vim (limited to 'base/vim/plugin') 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(':p:h')) + autocmd BufEnter * call gitbranch#detect(expand('%:p:h')) +augroup END + +let &cpo = s:save_cpo +unlet s:save_cpo -- cgit v1.2.3-70-g09d2