From 39cb28b7e3797aa20473a661ef1c3af1a35e7bc3 Mon Sep 17 00:00:00 2001 From: Evgeni Kolev Date: Sun, 15 Sep 2013 21:11:53 +0300 Subject: [PATCH 1/3] Solarized improvements. - Use gray for normal mode bg color - Add replace mode colors - Modify solarized dark colors --- autoload/airline/themes/solarized.vim | 42 ++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/autoload/airline/themes/solarized.vim b/autoload/airline/themes/solarized.vim index a8e5749..b8bb557 100644 --- a/autoload/airline/themes/solarized.vim +++ b/autoload/airline/themes/solarized.vim @@ -29,8 +29,6 @@ function! s:generate() let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#268bd2'} let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#2aa198'} let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#859900'} - let s:color236= {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 236), 'g': '#303030'} - let s:color251= {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 251), 'g': '#c6c6c6'} """""""""""""""""""""""""""""""""""""""""""""""" " Simple mappings @@ -38,21 +36,22 @@ function! s:generate() " the specific gui and terminal colors from the base color dicts. """""""""""""""""""""""""""""""""""""""""""""""" " Normal mode - let s:N1 = [s:base2, s:blue, 'bold'] if s:background == 'dark' - let s:N2 = [s:base2, s:base01, ''] - let s:N3 = [s:base1, s:base02, ''] - else + let s:N1 = [s:base3, s:base1, 'bold'] let s:N2 = [s:base2, s:base00, ''] - let s:N3 = [s:base00, s:base2, ''] + let s:N3 = [s:base01, s:base02, ''] + else + let s:N1 = [s:base2, s:base00, 'bold'] + let s:N2 = [s:base2, s:base1, ''] + let s:N3 = [s:base1, s:base2, ''] endif let s:NF = [s:orange, s:N3[1], ''] let s:NM = [s:orange, s:N3[1], ''] let s:NW = [s:base3, s:orange, ''] if s:background == 'dark' - let s:NM = [s:orange, s:N3[1], ''] + let s:NM = [s:base1, s:N3[1], ''] else - let s:NM = [s:red, s:N3[1], ''] + let s:NM = [s:base01, s:N3[1], ''] endif " Insert mode @@ -62,9 +61,9 @@ function! s:generate() else let s:I1 = [s:N1[0], s:orange, 'bold'] if s:background == 'dark' - let s:I2 = [s:base00, s:color236, ''] + let s:I2 = [s:base1, s:base00, ''] else - let s:I2 = [s:base00, s:color251, ''] + let s:I2 = [s:base2, s:base0, ''] endif endif let s:I3 = s:N3 @@ -77,7 +76,7 @@ function! s:generate() let s:V2 = s:N2 let s:V3 = s:N3 else - let s:V1 = [s:N1[0], s:green, 'bold'] + let s:V1 = [s:N1[0], s:magenta, 'bold'] let s:V2 = s:I2 let s:V3 = s:I3 endif @@ -88,6 +87,13 @@ function! s:generate() let s:VM = s:IM endif + " Replace mode + let s:R1 = [s:N1[0], s:magenta, ''] + let s:R2 = s:N2 + let s:R3 = s:N3 + let s:RM = s:NM + let s:RF = s:NF + " Inactive if s:background == 'dark' let s:IA = [s:base00, s:base02, ''] @@ -102,6 +108,7 @@ function! s:generate() let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]] let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]] let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]] + let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]] let g:airline#themes#solarized#palette.inactive = airline#themes#generate_color_map( \ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]], @@ -127,7 +134,6 @@ function! s:generate() let g:airline#themes#solarized#palette.normal_modified.airline_warning = \ g:airline#themes#solarized#palette.normal.airline_warning - let g:airline#themes#solarized#palette.insert = airline#themes#generate_color_map( \ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]], \ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]], @@ -148,6 +154,16 @@ function! s:generate() \ 'airline_c': [s:VM[0].g, s:VM[1].g, \ s:VM[0].t, s:VM[1].t, s:VM[2]]} + let g:airline#themes#solarized#palette.replace = airline#themes#generate_color_map( + \ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]], + \ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]], + \ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]], + \ s:RFa) + + let g:airline#themes#solarized#palette.replace_modified = { + \ 'airline_c': [s:RM[0].g, s:RM[1].g, + \ s:RM[0].t, s:RM[1].t, s:RM[2]]} + let g:airline#themes#solarized#palette.tabline = {} let g:airline#themes#solarized#palette.tabline.airline_tab = [ From e787b570e98d36930834a1ec0473c4a167062e11 Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Wed, 18 Sep 2013 12:28:02 +0700 Subject: [PATCH 2/3] Modify solarized normal mode tty colors --- autoload/airline/themes/solarized.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/airline/themes/solarized.vim b/autoload/airline/themes/solarized.vim index b8bb557..1a33d9f 100644 --- a/autoload/airline/themes/solarized.vim +++ b/autoload/airline/themes/solarized.vim @@ -38,11 +38,11 @@ function! s:generate() " Normal mode if s:background == 'dark' let s:N1 = [s:base3, s:base1, 'bold'] - let s:N2 = [s:base2, s:base00, ''] + let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), ''] let s:N3 = [s:base01, s:base02, ''] else let s:N1 = [s:base2, s:base00, 'bold'] - let s:N2 = [s:base2, s:base1, ''] + let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, ''] let s:N3 = [s:base1, s:base2, ''] endif let s:NF = [s:orange, s:N3[1], ''] @@ -61,9 +61,9 @@ function! s:generate() else let s:I1 = [s:N1[0], s:orange, 'bold'] if s:background == 'dark' - let s:I2 = [s:base1, s:base00, ''] + let s:I2 = [s:base1, (s:tty ? s:base01 : s:base00), ''] else - let s:I2 = [s:base2, s:base0, ''] + let s:I2 = [(s:tty ? s:base01 : s:base2), s:base0, ''] endif endif let s:I3 = s:N3 From a3df71463e342b7eb148db0d8707d373859810c7 Mon Sep 17 00:00:00 2001 From: Evgeni Kolev Date: Fri, 20 Sep 2013 21:51:45 +0300 Subject: [PATCH 3/3] Solarized modifications. - Remove 'reduced' option - Use yellow for insert, red for replace mode --- autoload/airline/themes/solarized.vim | 43 +++++++-------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/autoload/airline/themes/solarized.vim b/autoload/airline/themes/solarized.vim index 1a33d9f..d3ef4cb 100644 --- a/autoload/airline/themes/solarized.vim +++ b/autoload/airline/themes/solarized.vim @@ -4,7 +4,6 @@ function! s:generate() """""""""""""""""""""""""""""""""""""""""""""""" " Options """""""""""""""""""""""""""""""""""""""""""""""" - let s:reduced = get(g:, 'airline_solarized_reduced', 1) let s:background = get(g:, 'airline_solarized_bg', &background) let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0 let s:tty = &t_Co == 8 @@ -46,7 +45,6 @@ function! s:generate() let s:N3 = [s:base1, s:base2, ''] endif let s:NF = [s:orange, s:N3[1], ''] - let s:NM = [s:orange, s:N3[1], ''] let s:NW = [s:base3, s:orange, ''] if s:background == 'dark' let s:NM = [s:base1, s:N3[1], ''] @@ -55,44 +53,25 @@ function! s:generate() endif " Insert mode - if s:reduced - let s:I1 = [s:N1[0], s:green, 'bold'] - let s:I2 = s:N2 - else - let s:I1 = [s:N1[0], s:orange, 'bold'] - if s:background == 'dark' - let s:I2 = [s:base1, (s:tty ? s:base01 : s:base00), ''] - else - let s:I2 = [(s:tty ? s:base01 : s:base2), s:base0, ''] - endif - endif + let s:I1 = [s:N1[0], s:yellow, 'bold'] + let s:I2 = s:N2 let s:I3 = s:N3 let s:IF = s:NF let s:IM = s:NM " Visual mode - if s:reduced - let s:V1 = [s:N1[0], s:orange, 'bold'] - let s:V2 = s:N2 - let s:V3 = s:N3 - else - let s:V1 = [s:N1[0], s:magenta, 'bold'] - let s:V2 = s:I2 - let s:V3 = s:I3 - endif + let s:V1 = [s:N1[0], s:magenta, 'bold'] + let s:V2 = s:N2 + let s:V3 = s:N3 let s:VF = s:NF - if s:reduced - let s:VM = s:NM - else - let s:VM = s:IM - endif + let s:VM = s:NM " Replace mode - let s:R1 = [s:N1[0], s:magenta, ''] - let s:R2 = s:N2 - let s:R3 = s:N3 - let s:RM = s:NM - let s:RF = s:NF + let s:R1 = [s:N1[0], s:red, ''] + let s:R2 = s:N2 + let s:R3 = s:N3 + let s:RM = s:NM + let s:RF = s:NF " Inactive if s:background == 'dark'