From 0ef97304ca4cb272a2e519ec58af65fb07df65d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20N=C3=A4gele?= Date: Tue, 27 Aug 2013 14:20:00 +0200 Subject: [PATCH] fixed vim branchsign showing when not in git repo --- vimrc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vimrc b/vimrc index 11a65fa..034aa73 100644 --- a/vimrc +++ b/vimrc @@ -191,15 +191,20 @@ let g:lightline = { \ 'colorscheme': 'wombat', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], - \ [ 'filename', 'fugitive', 'modified' ] ] + \ [ 'filename', 'fugitive', 'modified' ] + \ ] \ }, \ 'component': { - \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', - \ 'fugitive': '%{exists("*fugitive#head")?"ᓯ ".fugitive#head():""}' + \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}' + \ }, + \ 'component_function': { + \ 'fugitive': 'MyFugitive', \ }, \ 'component_visible_condition': { - \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))', - \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())' + \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))' \ } \ } +function! MyFugitive() + return exists('*fugitive#head') && strlen(fugitive#head()) ? 'ᓯ '.fugitive#head() : '' +endfunction "" }}}