support initial theme when starting Vim

This commit is contained in:
Reed Esau
2014-01-22 00:09:28 -07:00
parent fc37119c62
commit a270825c59
2 changed files with 70 additions and 38 deletions

View File

@@ -13,8 +13,6 @@ let g:loaded_thematic = 1
let s:save_cpo = &cpo
set cpo&vim
let g:thematic#theme_name = ''
" Preserve original settings
let g:thematic#original = {}
@@ -73,6 +71,16 @@ noremap <silent> <Plug>ThematicPrevious :ThematicPrevious<CR>
noremap <silent> <Plug>ThematicRandom :ThematicRandom<CR>
noremap <silent> <Plug>ThematicOriginal :ThematicOriginal<CR>
if exists('g:thematic#theme_name')
" support an initial theme when starting Vim
augroup thematic_startup
autocmd!
autocmd VimEnter * call thematic#init(g:thematic#theme_name)
augroup END
else
let g:thematic#theme_name = ''
endif
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:ts=2:sw=2:sts=2