1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:50:05 +08:00

Update logo on command

This commit is contained in:
wsdjeg 2017-04-29 14:23:00 +08:00
parent f92a480dd4
commit a6f134ac30

View File

@ -1,6 +1,6 @@
let s:NUM = SpaceVim#api#import('data#number') let s:NUM = SpaceVim#api#import('data#number')
fu! s:update_logo()
if !exists('g:startify_custom_header') && !exists('g:_spacevim_welcome_banners') if !exists('g:startify_custom_header') && !exists('g:_spacevim_welcome_banners')
let g:startify_custom_header = [ let g:startify_custom_header = [
\'', \'',
\'', \'',
@ -18,9 +18,11 @@ if !exists('g:startify_custom_header') && !exists('g:_spacevim_welcome_banners')
\' version : ' . g:spacevim_version . ' by : spacevim.org', \' version : ' . g:spacevim_version . ' by : spacevim.org',
\'', \'',
\ ] \ ]
elseif exists('g:_spacevim_welcome_banners') elseif exists('g:_spacevim_welcome_banners')
let g:startify_custom_header = g:_spacevim_welcome_banners[s:NUM.random(0, len(g:_spacevim_welcome_banners))] let g:startify_custom_header = g:_spacevim_welcome_banners[s:NUM.random(0, len(g:_spacevim_welcome_banners))]
endif endif
endf
call s:update_logo()
let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session' let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session'
let g:startify_files_number = 6 let g:startify_files_number = 6
let g:startify_list_order = [ let g:startify_list_order = [
@ -50,12 +52,13 @@ fu! <SID>startify_mapping()
if getcwd() == $VIM || getcwd() == expand('~') if getcwd() == $VIM || getcwd() == expand('~')
nnoremap <silent><buffer> <c-p> :<c-u>CtrlP ~\DotFiles<cr> nnoremap <silent><buffer> <c-p> :<c-u>CtrlP ~\DotFiles<cr>
endif endif
call s:update_logo()
endf endf
augroup startify_map augroup startify_map
au! au!
autocmd FileType startify nnoremap <buffer><F2> <Nop> autocmd FileType startify nnoremap <buffer><F2> <Nop>
autocmd FileType startify call <SID>startify_mapping() autocmd FileType startify call <SID>startify_mapping()
autocmd FileType startify set scrolloff=0 autocmd FileType startify setl scrolloff=0 nowrap
augroup END augroup END
call SpaceVim#mapping#space#def('nnoremap', ['a','s'], 'Startify', 'fancy start screen',1) call SpaceVim#mapping#space#def('nnoremap', ['a','s'], 'Startify', 'fancy start screen',1)