From 23706dc67b1fa925d786d79db5b25cf3ee11a241 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Thu, 4 Jul 2013 11:58:14 +0000 Subject: [PATCH] make it easier to create new themes --- autoload/airline/themes/default.vim | 46 +++++++++++++++++------------ plugin/airline.vim | 1 - 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/autoload/airline/themes/default.vim b/autoload/airline/themes/default.vim index e8f34f53..5e43e99c 100644 --- a/autoload/airline/themes/default.vim +++ b/autoload/airline/themes/default.vim @@ -1,34 +1,42 @@ +let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ] +let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ] +let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ] let g:airline#themes#default#normal = { - \ 'mode': [ '#00005f' , '#dfff00' , 17 , 190 , 'bold' ] , - \ 'mode_separator': [ '#dfff00' , '#444444' , 190 , 238 , 'bold' ] , - \ 'info': [ '#ffffff' , '#444444' , 255 , 238 , '' ] , - \ 'info_separator': [ '#444444' , '#202020' , 238 , 234 , 'bold' ] , - \ 'statusline': [ '#9cffd3' , '#202020' , 85 , 234 , '' ] , - \ 'statusline_nc': [ '#000000' , '#202020' , 232 , 234 , '' ] , - \ 'file': [ '#ff0000' , '#1c1c1c' , 160 , 233 , '' ] , - \ 'inactive': [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] , + \ 'mode': [ s:N1[0] , s:N1[1] , s:N1[2] , s:N1[3] , 'bold' ] , + \ 'mode_separator': [ s:N1[1] , s:N2[1] , s:N1[3] , s:N2[3] , 'bold' ] , + \ 'info': [ s:N2[0] , s:N2[1] , s:N2[2] , s:N2[3] , '' ] , + \ 'info_separator': [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , 'bold' ] , + \ 'statusline': [ s:N3[0] , s:N3[1] , s:N3[2] , s:N3[3] , '' ] , + \ 'file': [ '#ff0000' , '#1c1c1c' , 160 , 233 , '' ] , + \ 'inactive': [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] , \ } let g:airline#themes#default#normal_modified = copy(g:airline#themes#default#normal) -let g:airline#themes#default#normal_modified.info_separator = [ '#444444' , '#5f005f' , 238 , 53 , '' ] +let g:airline#themes#default#normal_modified.info_separator = [ '#444444' , '#5f005f' , s:N2[3] , 53 , '' ] let g:airline#themes#default#normal_modified.statusline = [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] +let s:I1 = [ '#00005f' , '#00dfff' , 17 , 45 ] +let s:I2 = [ '#ffffff' , '#005fff' , 255 , 27 ] +let s:I3 = [ '#ffffff' , '#000080' , 15 , 17 ] let g:airline#themes#default#insert = { - \ 'mode': [ '#00005f' , '#00dfff' , 17 , 45 , 'bold' ] , - \ 'mode_separator': [ '#00dfff' , '#005fff' , 45 , 27 , 'bold' ] , - \ 'info': [ '#ffffff' , '#005fff' , 255 , 27 , '' ] , - \ 'info_separator': [ '#005fff' , '#000087' , 27 , 18 , 'bold' ] , - \ 'statusline': [ '#ffffff' , '#000080' , 15 , 17 , '' ] , + \ 'mode': [ s:I1[0] , s:I1[1] , s:I1[2] , s:I1[3] , 'bold' ] , + \ 'mode_separator': [ s:I1[1] , s:I2[1] , s:I1[3] , s:I2[3] , 'bold' ] , + \ 'info': [ s:I2[0] , s:I2[1] , s:I2[2] , s:I2[3] , '' ] , + \ 'info_separator': [ s:I2[1] , s:I3[1] , s:I2[3] , s:I3[3] , 'bold' ] , + \ 'statusline': [ s:I3[0] , s:I3[1] , s:I3[2] , s:I3[3] , '' ] , \ } let g:airline#themes#default#insert_modified = copy(g:airline#themes#default#insert) let g:airline#themes#default#insert_modified.info_separator = [ '#005fff' , '#5f005f' , 27 , 53 , '' ] let g:airline#themes#default#insert_modified.statusline = [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] +let s:V1 = [ '#000000' , '#ffaf00' , 232 , 214 ] +let s:V2 = [ '#000000' , '#ff5f00' , 232 , 202 ] +let s:V3 = [ '#ffffff' , '#5f0000' , 15 , 52 ] let g:airline#themes#default#visual = { - \ 'mode': [ '#000000' , '#ffaf00' , 232 , 214 , 'bold' ] , - \ 'mode_separator': [ '#ffaf00' , '#ff5f00' , 214 , 202 , 'bold' ] , - \ 'info': [ '#000000' , '#ff5f00' , 232 , 202 , '' ] , - \ 'info_separator': [ '#ff5f00' , '#5f0000' , 202 , 52 , 'bold' ] , - \ 'statusline': [ '#ffffff' , '#5f0000' , 15 , 52 , '' ] , + \ 'mode': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , 'bold' ] , + \ 'mode_separator': [ s:V1[1] , s:V2[1] , s:V1[3] , s:V2[3] , 'bold' ] , + \ 'info': [ s:V2[0] , s:V2[1] , s:V2[2] , s:V2[3] , '' ] , + \ 'info_separator': [ s:V2[1] , s:V3[1] , s:V2[3] , s:V3[3] , 'bold' ] , + \ 'statusline': [ s:V3[0] , s:V3[1] , s:V3[2] , s:V3[3] , '' ] , \ } let g:airline#themes#default#visual_modified = copy(g:airline#themes#default#visual) let g:airline#themes#default#visual_modified.info_separator = [ '#ff5f00' , '#5f005f' , 202 , 53 , '' ] diff --git a/plugin/airline.vim b/plugin/airline.vim index 903ef6fd..bb02965e 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -42,7 +42,6 @@ let s:airline_highlight_map = { \ 'info' : 'User4', \ 'info_separator' : 'User5', \ 'statusline' : 'User6', - \ 'statusline_nc' : 'User7', \ 'file' : 'User8', \ 'inactive' : 'User9', \ }