Temporarily disable vim-powerline (#1)

This commit is contained in:
Junegunn Choi
2013-12-02 23:16:28 +09:00
parent eb92e8033b
commit 7e6087a07c

View File

@@ -126,18 +126,27 @@ function! s:goyo_on(width)
\ 'statusline': &statusline
\ }
" gitgutter
" vim-gitgutter
let t:goyo_disabled_gitgutter = get(g:, 'gitgutter_enabled', 0)
if t:goyo_disabled_gitgutter
GitGutterDisable
endif
" airline
" vim-airline
let t:goyo_disabled_airline = exists("#airline")
if t:goyo_disabled_airline
AirlineToggle
endif
" vim-powerline
let t:goyo_disabled_powerline = exists("#PowerlineMain")
if t:goyo_disabled_powerline
augroup PowerlineMain
autocmd!
augroup END
augroup! PowerlineMain
endif
if !get(g:, 'goyo_linenr', 0)
set nonu nornu
endif
@@ -187,6 +196,7 @@ function! s:goyo_off()
let goyo_revert = t:goyo_revert
let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter
let goyo_disabled_airline = t:goyo_disabled_airline
let goyo_disabled_powerline = t:goyo_disabled_powerline
if tabpagenr() == 1
tabnew
@@ -204,8 +214,14 @@ function! s:goyo_off()
GitGutterEnable
endif
if goyo_disabled_airline
if goyo_disabled_airline && !exists("#airline")
AirlineToggle
AirlineRefresh
endif
if goyo_disabled_powerline && !exists("#PowerlineMain")
doautocmd PowerlineStartup VimEnter
silent! PowerlineReloadColorscheme
endif
endfunction