1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 10:40:03 +08:00

Add dynamic welcome page

This commit is contained in:
wsdjeg 2017-04-12 22:08:24 +08:00
parent 4e5fd03ada
commit 25ae11fca0
2 changed files with 46 additions and 17 deletions

View File

@ -0,0 +1,23 @@
function! SpaceVim#layers#core#banner#config() abort
let g:_spacevim_welcome_banners = [
\ [
\'',
\'',
\' /###### /## /##/## ',
\' /##__ ## | ## | #|__/ ',
\' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ',
\' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##',
\' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##',
\' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##',
\' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##',
\' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/',
\' | ## ',
\' | ## ',
\' |__/ ',
\' version : ' . g:spacevim_version . ' by : spacevim.org',
\'',
\ ],
\ ]
endfunction
" vim:set et sw=2:

View File

@ -1,20 +1,26 @@
let g:startify_custom_header = get(g:, 'startify_custom_header', [
\'',
\'',
\' /###### /## /##/## ',
\' /##__ ## | ## | #|__/ ',
\' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ',
\' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##',
\' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##',
\' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##',
\' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##',
\' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/',
\' | ## ',
\' | ## ',
\' |__/ ',
\' version : ' . g:spacevim_version . ' by : spacevim.org',
\'',
\ ])
let s:NUM = SpaceVim#api#import('data#number')
if !exists('g:startify_custom_header') && !exists('g:_spacevim_welcome_banners')
let g:startify_custom_header = [
\'',
\'',
\' /###### /## /##/## ',
\' /##__ ## | ## | #|__/ ',
\' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ',
\' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##',
\' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##',
\' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##',
\' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##',
\' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/',
\' | ## ',
\' | ## ',
\' |__/ ',
\' version : ' . g:spacevim_version . ' by : spacevim.org',
\'',
\ ]
elseif exists('g:_spacevim_welcome_banners')
let g:startify_custom_header = g:_spacevim_welcome_banners[s:NUM.random(0, len(g:_spacevim_welcome_banners))]
endif
let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session'
let g:startify_files_number = 6
let g:startify_list_order = [