mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
use random colorscheme on startup
This commit is contained in:
parent
c7c8f8a4ec
commit
e79c215cb0
17
plugins.vim
17
plugins.vim
@ -97,15 +97,14 @@ endif
|
|||||||
" A list of colorscheme plugin you may want to try. Find what suits you.
|
" A list of colorscheme plugin you may want to try. Find what suits you.
|
||||||
Plug 'lifepillar/vim-gruvbox8'
|
Plug 'lifepillar/vim-gruvbox8'
|
||||||
Plug 'srcery-colors/srcery-vim'
|
Plug 'srcery-colors/srcery-vim'
|
||||||
" Plug 'sjl/badwolf'
|
Plug 'sjl/badwolf'
|
||||||
" Plug 'ajmwagar/vim-deus'
|
Plug 'ajmwagar/vim-deus'
|
||||||
" Plug 'sainnhe/vim-color-desert-night'
|
Plug 'YorickPeterse/happy_hacking.vim'
|
||||||
" Plug 'YorickPeterse/happy_hacking.vim'
|
Plug 'lifepillar/vim-solarized8'
|
||||||
" Plug 'lifepillar/vim-solarized8'
|
Plug 'sickill/vim-monokai'
|
||||||
" Plug 'sickill/vim-monokai'
|
Plug 'whatyouhide/vim-gotham'
|
||||||
" Plug 'whatyouhide/vim-gotham'
|
Plug 'rakr/vim-one'
|
||||||
" Plug 'rakr/vim-one'
|
Plug 'kaicataldo/material.vim'
|
||||||
" Plug 'kaicataldo/material.vim'
|
|
||||||
|
|
||||||
if !exists('g:started_by_firenvim')
|
if !exists('g:started_by_firenvim')
|
||||||
" colorful status line and theme
|
" colorful status line and theme
|
||||||
|
|||||||
88
ui.vim
88
ui.vim
@ -12,7 +12,18 @@ set background=dark
|
|||||||
"}}
|
"}}
|
||||||
|
|
||||||
"{{ Colorscheme settings
|
"{{ Colorscheme settings
|
||||||
""""""""""""""""""""""""""""gruvbox settings"""""""""""""""""""""""""""
|
let s:candidate_theme = ['gruvbox8', 'srcery', 'badwolf', 'deus', 'happy_hacking', 'solarized8',
|
||||||
|
\ 'monokai', 'gotham', 'vim_one', 'material']
|
||||||
|
let s:idx = utils#RandInt(0, len(s:candidate_theme)-1)
|
||||||
|
let s:theme = s:candidate_theme[s:idx]
|
||||||
|
|
||||||
|
let s:my_theme_dict = {}
|
||||||
|
|
||||||
|
function! s:my_theme_dict.srcery() dict abort
|
||||||
|
colorscheme srcery
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.gruvbox8() dict abort
|
||||||
" We should check if theme exists before using it, otherwise you will get
|
" We should check if theme exists before using it, otherwise you will get
|
||||||
" error message when starting Nvim
|
" error message when starting Nvim
|
||||||
if utils#HasColorscheme('gruvbox8')
|
if utils#HasColorscheme('gruvbox8')
|
||||||
@ -26,6 +37,81 @@ if utils#HasColorscheme('gruvbox8')
|
|||||||
else
|
else
|
||||||
colorscheme desert
|
colorscheme desert
|
||||||
endif
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.srcery() dict abort
|
||||||
|
if utils#HasColorscheme('srcery')
|
||||||
|
colorscheme srcery
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.badwolf() dict abort
|
||||||
|
if utils#HasColorscheme('badwolf')
|
||||||
|
colorscheme badwolf
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.deus() dict abort
|
||||||
|
if utils#HasColorscheme('deus')
|
||||||
|
colorscheme deus
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.happy_hacking() dict abort
|
||||||
|
if utils#HasColorscheme('happy_hacking')
|
||||||
|
colorscheme happy_hacking
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.solarized8() dict abort
|
||||||
|
if utils#HasColorscheme('solarized8')
|
||||||
|
colorscheme solarized8
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.monokai() dict abort
|
||||||
|
if utils#HasColorscheme('monokai')
|
||||||
|
colorscheme monokai
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.gotham() dict abort
|
||||||
|
if utils#HasColorscheme('gotham')
|
||||||
|
colorscheme gotham
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.vim_one() dict abort
|
||||||
|
if utils#HasColorscheme('one')
|
||||||
|
colorscheme one
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:my_theme_dict.material() dict abort
|
||||||
|
if utils#HasColorscheme('material')
|
||||||
|
colorscheme material
|
||||||
|
else
|
||||||
|
colorscheme desert
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
execute printf('call s:my_theme_dict.%s()', s:theme)
|
||||||
|
|
||||||
""""""""""""""""""""""""""" deus settings"""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""" deus settings"""""""""""""""""""""""""""""""""
|
||||||
" colorscheme deus
|
" colorscheme deus
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user