VIM: Hides git branch "blob" on status line if not in a git project

Jonathan Hodgson 3 years ago
parent bf8631198c
commit 91c195a66a
  1. 9
      nvim/.config/nvim/plugin/statusline.vim

@ -85,9 +85,12 @@ function! DetectMode(mode)
" git branch
if exists("*FugitiveHead")
let statusline .= "%#GruvboxBg4#\ " . left
let statusline .= "%#PmenuThumb#%{FugitiveHead()}"
let statusline .= "%#GruvboxBg4#" . right . "\ "
let head = FugitiveHead()
if head != ''
let statusline .= "%#GruvboxBg4#\ " . left
let statusline .= "%#PmenuThumb#" . head
let statusline .= "%#GruvboxBg4#" . right . "\ "
endif
endif
" Filetype

Loading…
Cancel
Save