aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2020-10-18 23:03:34 +0800
committerjdhao <jdhao@hotmail.com>2020-10-18 23:03:34 +0800
commit9ffdef5894ff83be7b7e1ef073e394a2dd873eb4 (patch)
tree8ee014a7d5bf67e60e19c6dc2f4ca4c9537ba111
parent9718b60dbfa0406b2edb48a77828933e08ae641f (diff)
refactor: change colorscheme config func logic
-rw-r--r--ui.vim104
1 files changed, 52 insertions, 52 deletions
diff --git a/ui.vim b/ui.vim
index 2352065..9d257af 100644
--- a/ui.vim
+++ b/ui.vim
@@ -26,91 +26,91 @@ endfunction
function! s:my_theme_dict.gruvbox8() dict abort
" We should check if theme exists before using it, otherwise you will get
" error message when starting Nvim
- if utils#HasColorscheme('gruvbox8')
- " Italic options should be put before colorscheme setting,
- " see https://github.com/morhetz/gruvbox/wiki/Terminal-specific#1-italics-is-disabled
- let g:gruvbox_italics=1
- let g:gruvbox_italicize_strings=1
- let g:gruvbox_filetype_hi_groups = 0
- let g:gruvbox_plugin_hi_groups = 0
- colorscheme gruvbox8_hard
- endif
+ if !utils#HasColorscheme('gruvbox8') | return | endif
+
+ " Italic options should be put before colorscheme setting,
+ " see https://github.com/morhetz/gruvbox/wiki/Terminal-specific#1-italics-is-disabled
+ let g:gruvbox_italics=1
+ let g:gruvbox_italicize_strings=1
+ let g:gruvbox_filetype_hi_groups = 0
+ let g:gruvbox_plugin_hi_groups = 0
+ colorscheme gruvbox8_hard
endfunction
function! s:my_theme_dict.srcery() dict abort
- if utils#HasColorscheme('srcery')
- colorscheme srcery
- endif
+ if !utils#HasColorscheme('srcery') | return | endif
+
+ colorscheme srcery
endfunction
function! s:my_theme_dict.badwolf() dict abort
- if utils#HasColorscheme('badwolf')
- let g:badwolf_darkgutter = 0
- " Make the tab line lighter than the background.
- let g:badwolf_tabline = 2
- colorscheme badwolf
- endif
+ if !utils#HasColorscheme('badwolf') | return | endif
+
+ let g:badwolf_darkgutter = 0
+ " Make the tab line lighter than the background.
+ let g:badwolf_tabline = 2
+ colorscheme badwolf
endfunction
function! s:my_theme_dict.deus() dict abort
- if utils#HasColorscheme('deus')
- colorscheme deus
- endif
+ if !utils#HasColorscheme('deus') | return | endif
+
+ colorscheme deus
endfunction
function! s:my_theme_dict.happy_hacking() dict abort
- if utils#HasColorscheme('happy_hacking')
- colorscheme happy_hacking
- endif
+ if !utils#HasColorscheme('happy_hacking') | return | endif
+
+ colorscheme happy_hacking
endfunction
function! s:my_theme_dict.solarized8() dict abort
- if utils#HasColorscheme('solarized8')
- let g:solarized_term_italics=1
- let g:solarized_visibility='high'
- colorscheme solarized8_flat
- endif
+ if !utils#HasColorscheme('solarized8') | return | endif
+
+ let g:solarized_term_italics=1
+ let g:solarized_visibility='high'
+ colorscheme solarized8_flat
endfunction
function! s:my_theme_dict.monokai() dict abort
- if utils#HasColorscheme('monokai')
- colorscheme monokai
- endif
+ if !utils#HasColorscheme('monokai') | return | endif
+
+ colorscheme monokai
endfunction
function! s:my_theme_dict.gotham() dict abort
- if utils#HasColorscheme('gotham')
- colorscheme gotham
- endif
+ if !utils#HasColorscheme('gotham') | return | endif
+
+ colorscheme gotham
endfunction
function! s:my_theme_dict.vim_one() dict abort
- if utils#HasColorscheme('one')
- let g:one_allow_italics = 1
- colorscheme one
- endif
+ if !utils#HasColorscheme('one') | return | endif
+
+ let g:one_allow_italics = 1
+ colorscheme one
endfunction
function! s:my_theme_dict.material() dict abort
- if utils#HasColorscheme('material')
- let g:material_terminal_italics = 1
- " theme_style can be 'default', 'dark' or 'palenight'
- let g:material_theme_style = 'default'
- colorscheme material
- endif
+ if !utils#HasColorscheme('material') | return | endif
+
+ let g:material_terminal_italics = 1
+ " theme_style can be 'default', 'dark' or 'palenight'
+ let g:material_theme_style = 'default'
+ colorscheme material
endfunction
function! s:my_theme_dict.onedark() dict abort
- if utils#HasColorscheme('onedark')
- let g:onedark_terminal_italics = 1
- colorscheme onedark
- endif
+ if !utils#HasColorscheme('onedark') | return | endif
+
+ let g:onedark_terminal_italics = 1
+ colorscheme onedark
endfunction
function! s:my_theme_dict.neodark() dict abort
- if utils#HasColorscheme('neodark')
- colorscheme neodark
- endif
+ if !utils#HasColorscheme('neodark') | return | endif
+
+ colorscheme neodark
endfunction
execute printf('call s:my_theme_dict.%s()', s:theme)